File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
packages/cubejs-mysql-driver Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -143,9 +143,9 @@ class MySqlDriver extends BaseDriver {
143
143
const tableName = crypto . randomBytes ( 10 ) . toString ( 'hex' ) ;
144
144
const columns = await this . withConnection ( async db => {
145
145
await this . setTimeZone ( db ) ;
146
- await db . execute ( `CREATE TEMPORARY TABLE ${ this . config . database } .t_${ tableName } AS ${ query } LIMIT 0` , values ) ;
147
- const result = await db . execute ( `DESCRIBE ${ this . config . database } .t_${ tableName } ` ) ;
148
- await db . execute ( `DROP TEMPORARY TABLE ${ this . config . database } .t_${ tableName } ` ) ;
146
+ await db . execute ( `CREATE TEMPORARY TABLE \` ${ this . config . database } \` .t_${ tableName } AS ${ query } LIMIT 0` , values ) ;
147
+ const result = await db . execute ( `DESCRIBE \` ${ this . config . database } \` .t_${ tableName } ` ) ;
148
+ await db . execute ( `DROP TEMPORARY TABLE \` ${ this . config . database } \` .t_${ tableName } ` ) ;
149
149
return result ;
150
150
} ) ;
151
151
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ describe('MySqlDriver', () => {
20
20
host : 'localhost' ,
21
21
user : 'root' ,
22
22
password : process . env . TEST_DB_PASSWORD || "Test1test" ,
23
- port : container && container . getMappedPort ( 3306 ) || 3306
23
+ port : container && container . getMappedPort ( 3306 ) || 3306 ,
24
+ database : 'mysql'
24
25
} ) ;
25
26
await mySqlDriver . createSchemaIfNotExists ( 'test' ) ;
26
27
await mySqlDriver . query ( 'DROP SCHEMA test' ) ;
@@ -40,6 +41,8 @@ describe('MySqlDriver', () => {
40
41
} ) ;
41
42
expect ( JSON . parse ( JSON . stringify ( await mySqlDriver . query ( 'select * from test.wrong_value' ) ) ) )
42
43
. toStrictEqual ( [ { value : "Tekirdağ" } ] ) ;
44
+ expect ( JSON . parse ( JSON . stringify ( ( await mySqlDriver . downloadQueryResults ( 'select * from test.wrong_value' ) ) . rows ) ) )
45
+ . toStrictEqual ( [ { value : "Tekirdağ" } ] ) ;
43
46
} ) ;
44
47
45
48
test ( 'boolean field' , async ( ) => {
You can’t perform that action at this time.
0 commit comments