diff options
author | Nirbhay Choubey <nirbhay.choubey@sun.com> | 2011-01-14 20:11:00 +0530 |
---|---|---|
committer | Nirbhay Choubey <nirbhay.choubey@sun.com> | 2011-01-14 20:11:00 +0530 |
commit | ad6c8d2342c791a9810fb0f98cc7ae17ef397458 (patch) | |
tree | 837bc6c9c6e3dde2603b090b90f93fe9ff2d95aa /client | |
parent | 745a9f92ec7feb22071d5c867b020fb0fcd0251e (diff) | |
parent | ab2d29ec6b84eb4531d2d63887ac29f7d9617e60 (diff) | |
download | mariadb-git-ad6c8d2342c791a9810fb0f98cc7ae17ef397458.tar.gz |
Merging fix of Bug#13618 from mysql-5.1.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqldump.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index 2d38e94f0fb..5c3dc5ddd04 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2237,6 +2237,15 @@ static uint get_table_structure(char *table, char *db, char *table_type, const char *insert_option; char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3]; char table_buff2[NAME_LEN*2+3], query_buff[QUERY_LENGTH]; + const char *show_fields_stmt= "SELECT `COLUMN_NAME` AS `Field`, " + "`COLUMN_TYPE` AS `Type`, " + "`IS_NULLABLE` AS `Null`, " + "`COLUMN_KEY` AS `Key`, " + "`COLUMN_DEFAULT` AS `Default`, " + "`EXTRA` AS `Extra`, " + "`COLUMN_COMMENT` AS `Comment` " + "FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE " + "TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'"; FILE *sql_file= md_result_file; int len; MYSQL_RES *result; @@ -2504,8 +2513,8 @@ static uint get_table_structure(char *table, char *db, char *table_type, verbose_msg("%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n", my_progname, mysql_error(mysql)); - my_snprintf(query_buff, sizeof(query_buff), "show fields from %s", - result_table); + my_snprintf(query_buff, sizeof(query_buff), show_fields_stmt, db, table); + if (mysql_query_with_error_report(mysql, &result, query_buff)) DBUG_RETURN(0); |