-
-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
var s_query_create_table1 = `
CREATE TABLE users (
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(100) NOT NULL,
created_at timestamp not null default current_timestamp,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
`
var s_query_create_table2 = `
CREATE TABLE users2 (
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(100) NOT NULL,
created_at timestamp not null default current_timestamp,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
`
// executing the querys one by one works
result = await client.execute(s_query_create_table1)
result = await client.execute(s_query_create_table2)
// executing both querys at the same time does not work
result = await client.execute(`${s_query_create_table1};${s_query_create_table2}`)the error is:
INFO close connection error: Uncaught (in promise) Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '; CREATE TABLE users2 ( id int(11) NOT NULL AUTO_INCREMENT, name varchar' at line 7 throw new Error(error.message);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels