mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Merge mysql.com:/home/bkroot/mysql-4.1-rpl
into mysql.com:/home/bk/MERGE/mysql-4.1-merge sql/item_timefunc.cc: Auto merged sql/set_var.cc: Auto merged
This commit is contained in:
commit
5aa8705ab6
16 changed files with 1484 additions and 183 deletions
|
|
@ -2589,6 +2589,8 @@ static char *primary_key_fields(const char *table_name)
|
|||
char show_keys_buff[15 + 64 * 2 + 3];
|
||||
uint result_length = 0;
|
||||
char *result = 0;
|
||||
char buff[NAME_LEN * 2 + 3];
|
||||
char *quoted_field;
|
||||
|
||||
my_snprintf(show_keys_buff, sizeof(show_keys_buff),
|
||||
"SHOW KEYS FROM %s", table_name);
|
||||
|
|
@ -2612,8 +2614,10 @@ static char *primary_key_fields(const char *table_name)
|
|||
{
|
||||
/* Key is unique */
|
||||
do
|
||||
result_length += strlen(row[4]) + 1; /* + 1 for ',' or \0 */
|
||||
while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1);
|
||||
{
|
||||
quoted_field= quote_name(row[4], buff, 0);
|
||||
result_length+= strlen(quoted_field) + 1; /* + 1 for ',' or \0 */
|
||||
} while ((row= mysql_fetch_row(res)) && atoi(row[3]) > 1);
|
||||
}
|
||||
|
||||
/* Build the ORDER BY clause result */
|
||||
|
|
@ -2627,9 +2631,13 @@ static char *primary_key_fields(const char *table_name)
|
|||
}
|
||||
mysql_data_seek(res, 0);
|
||||
row = mysql_fetch_row(res);
|
||||
end = strmov(result, row[4]);
|
||||
while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1)
|
||||
end = strxmov(end, ",", row[4], NullS);
|
||||
quoted_field= quote_name(row[4], buff, 0);
|
||||
end= strmov(result, quoted_field);
|
||||
while ((row= mysql_fetch_row(res)) && atoi(row[3]) > 1)
|
||||
{
|
||||
quoted_field= quote_name(row[4], buff, 0);
|
||||
end= strxmov(end, ",", quoted_field, NullS);
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue