Add precision/scale

This commit is contained in:
Raymond Feng 2013-07-25 15:03:03 -07:00
parent 382f99b9c6
commit 24922bc98b
1 changed files with 2 additions and 2 deletions

View File

@ -154,14 +154,14 @@ function mixinDiscovery(MySQL) {
var sql = null; var sql = null;
if (owner) { if (owner) {
sql = paginateSQL('SELECT table_schema 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", 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'
+ ' WHERE table_schema=\'' + owner + '\'' + ' WHERE table_schema=\'' + owner + '\''
+ (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 SUBSTRING_INDEX(USER(), \'@\', 1) AS "owner", table_name AS "tableName", column_name AS "columnName", data_type AS "dataType",'
+ ' character_octet_length AS "dataLength", 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 + '\'' : ''),
'table_name, ordinal_position', {}); 'table_name, ordinal_position', {});