|
1 | 1 | import { getArgs } from "../helpers.js";
|
2 | 2 |
|
3 |
| -const args = getArgs(); |
| 3 | +const { dbName } = getArgs(); |
4 | 4 |
|
5 | 5 | export const tableTests = [
|
6 | 6 | {
|
@@ -74,7 +74,7 @@ export const tableTests = [
|
74 | 74 | FROM information_schema.statistics
|
75 | 75 | WHERE table_schema=:tableSchema AND table_name=:tableName AND index_name!="PRIMARY"
|
76 | 76 | GROUP BY index_name;`,
|
77 |
| - p: { tableSchema: `${args.dbName}/main`, tableName: "test" }, |
| 77 | + p: { tableSchema: `${dbName}/main`, tableName: "test" }, |
78 | 78 | res: [
|
79 | 79 | {
|
80 | 80 | TABLE_NAME: "test",
|
@@ -116,25 +116,25 @@ export const tableTests = [
|
116 | 116 | q: `SHOW FULL TABLES AS OF :refName WHERE table_type = 'BASE TABLE'`,
|
117 | 117 | p: { refName: "main" },
|
118 | 118 | res: [
|
119 |
| - { "Tables_in_mysql_client/main": "test", Table_type: "BASE TABLE" }, |
120 |
| - { "Tables_in_mysql_client/main": "test_info", Table_type: "BASE TABLE" }, |
| 119 | + { [`Tables_in_${dbName}/main`]: "test", Table_type: "BASE TABLE" }, |
| 120 | + { [`Tables_in_${dbName}/main`]: "test_info", Table_type: "BASE TABLE" }, |
121 | 121 | ],
|
122 | 122 | },
|
123 | 123 | {
|
124 | 124 | q: `SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE table_name=:tableName AND table_schema=:tableSchema AND referenced_table_schema IS NOT NULL`,
|
125 |
| - p: { tableName: "test_info", tableSchema: `${args.dbName}/main` }, |
| 125 | + p: { tableName: "test_info", tableSchema: `${dbName}/main` }, |
126 | 126 | res: [
|
127 | 127 | {
|
128 | 128 | CONSTRAINT_CATALOG: "def",
|
129 |
| - CONSTRAINT_SCHEMA: "mysql_client/main", |
| 129 | + CONSTRAINT_SCHEMA: `${dbName}/main`, |
130 | 130 | CONSTRAINT_NAME: "s7utamh8",
|
131 | 131 | TABLE_CATALOG: "def",
|
132 |
| - TABLE_SCHEMA: "mysql_client/main", |
| 132 | + TABLE_SCHEMA: `${dbName}/main`, |
133 | 133 | TABLE_NAME: "test_info",
|
134 | 134 | COLUMN_NAME: "test_pk",
|
135 | 135 | ORDINAL_POSITION: 1,
|
136 | 136 | POSITION_IN_UNIQUE_CONSTRAINT: 1,
|
137 |
| - REFERENCED_TABLE_SCHEMA: "mysql_client/main", |
| 137 | + REFERENCED_TABLE_SCHEMA: `${dbName}/main`, |
138 | 138 | REFERENCED_TABLE_NAME: "test",
|
139 | 139 | REFERENCED_COLUMN_NAME: "pk",
|
140 | 140 | },
|
|
0 commit comments