summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2007-07-24 18:15:44 +0400
committerunknown <evgen@moonbone.local>2007-07-24 18:15:44 +0400
commitc4d53e31b0d7c242ebcaaf354605fa4ebbad0acc (patch)
tree1a223ff0ee13bc0f3db4dfa3b6d1005dd2551b31 /sql
parentc29002a5b64a2d8646517151b8d01713b781b7d6 (diff)
downloadmariadb-git-c4d53e31b0d7c242ebcaaf354605fa4ebbad0acc.tar.gz
Bug#15130: CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT.
When the SQL_BIG_RESULT flag is specified SELECT should store items from the select list in the filesort data and use them when sending to a client. The get_addon_fields function is responsible for creating necessary structures for that. But this function was allowed to do so only for SELECT and INSERT .. SELECT queries. This makes the SQL_BIG_RESULT useless for the CREATE .. SELECT queries. Now the get_addon_fields allows storing select list items in the filesort data for the CREATE .. SELECT queries. mysql-test/t/create.test: Added a test case for the bug#15130: CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT. mysql-test/r/create.result: Added a test case for the bug#15130: CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT. sql/filesort.cc: Bug#15130: CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT. Now the get_addon_fields allows storing select list items in the filesort data for the CREATE .. SELECT queries.
Diffstat (limited to 'sql')
-rw-r--r--sql/filesort.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index f8868ed6927..db73ede99b0 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -1430,7 +1430,8 @@ get_addon_fields(THD *thd, Field **ptabfield, uint sortlength, uint *plength)
doesn't work for alter table
*/
if (thd->lex->sql_command != SQLCOM_SELECT &&
- thd->lex->sql_command != SQLCOM_INSERT_SELECT)
+ thd->lex->sql_command != SQLCOM_INSERT_SELECT &&
+ thd->lex->sql_command != SQLCOM_CREATE_TABLE)
return 0;
for (pfield= ptabfield; (field= *pfield) ; pfield++)
{