Fix the table_schema name

This commit is contained in:
Raymond Feng 2013-10-22 11:45:31 -07:00
parent 20305878d2
commit 839d7b4563
1 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ function mixinDiscovery(MySQL) {
+ ' FROM information_schema.tables WHERE table_schema=\'' + owner + '\'', 'table_schema, table_name', options); + ' FROM information_schema.tables WHERE table_schema=\'' + owner + '\'', 'table_schema, table_name', options);
} else { } else {
sqlTables = paginateSQL('SELECT \'table\' AS "type", table_name AS "name",' sqlTables = paginateSQL('SELECT \'table\' AS "type", table_name AS "name",'
+ ' SUBSTRING_INDEX(USER(), \'@\', 1) AS "owner" FROM information_schema.tables', + ' table_schema AS "owner" FROM information_schema.tables',
'table_name', options); 'table_name', options);
} }
return sqlTables; return sqlTables;
@ -62,7 +62,7 @@ function mixinDiscovery(MySQL) {
'table_schema, table_name', options); 'table_schema, table_name', options);
} else { } else {
sqlViews = paginateSQL('SELECT \'view\' AS "type", table_name AS "name",' sqlViews = paginateSQL('SELECT \'view\' AS "type", table_name AS "name",'
+ ' SUBSTRING_INDEX(USER(), \'@\', 1) AS "owner" FROM information_schema.views', + ' table_schema AS "owner" FROM information_schema.views',
'table_name', options); 'table_name', options);
} }
} }
@ -164,7 +164,7 @@ function mixinDiscovery(MySQL) {
+ (table ? ' AND table_name=\'' + table + '\'' : ''), + (table ? ' AND table_name=\'' + table + '\'' : ''),
'table_name, ordinal_position', {}); 'table_name, ordinal_position', {});
} else { } else {
sql = paginateSQL('SELECT SUBSTRING_INDEX(USER(), \'@\', 1) AS "owner", table_name AS "tableName", column_name AS "columnName", data_type AS "dataType",' sql = paginateSQL('SELECT table_schema AS "owner", table_name AS "tableName", column_name AS "columnName", data_type AS "dataType",'
+ ' character_octet_length AS "dataLength", numeric_precision AS "dataPrecision", numeric_scale AS "dataScale", is_nullable AS "nullable"' + ' character_octet_length AS "dataLength", numeric_precision AS "dataPrecision", numeric_scale AS "dataScale", is_nullable AS "nullable"'
+ ' FROM information_schema.columns' + ' FROM information_schema.columns'
+ (table ? ' WHERE table_name=\'' + table + '\'' : ''), + (table ? ' WHERE table_name=\'' + table + '\'' : ''),