summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <monty@tik.mysql.fi>2002-03-02 09:51:24 +0200
committerunknown <monty@tik.mysql.fi>2002-03-02 09:51:24 +0200
commitad4fcb8a01f297f914e9e75d44b04e10fd91eb97 (patch)
tree7c46a4aab7560f176209fe10d40e1ec2df488a46 /client
parentae670b76660fd66d046fd96af88be303c1d91006 (diff)
downloadmariadb-git-ad4fcb8a01f297f914e9e75d44b04e10fd91eb97.tar.gz
Fix sorting of NULL values (Should always be first)
Fix problem with HAVING and MAX() IS NOT NULL Docs/manual.texi: Changelog & NULL usage with ORDER BY client/mysqldump.c: Cleanup disable keys mysql-test/r/distinct.result: Fix results after ORDER BY with NULL fix mysql-test/r/group_by.result: Fix results after ORDER BY with NULL fix mysql-test/r/having.result: Testcase for bug with HAVING mysql-test/t/distinct.test: Test for DISTINCT + ORDER BY DESC bug mysql-test/t/having.test: Test of HAVING and MAX IS NOT NULL sql/filesort.cc: Fix sorting of NULL values (Should always be first) sql/item.h: Fix problem with HAVING and MAX() IS NOT NULL sql/item_sum.h: Fix problem with HAVING and MAX() IS NOT NULL sql/opt_range.cc: Fix problem with HAVING and MAX() IS NOT NULL sql/opt_range.h: Fix sorting of NULL values sql/sql_select.cc: Fix sorting of ORDER BY ... DESC on NULL values.
Diffstat (limited to 'client')
-rw-r--r--client/mysqldump.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index da708849992..c2e3d7dad3c 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -35,7 +35,7 @@
** and adapted to mysqldump 05/11/01 by Jani Tolonen
*/
-#define DUMP_VERSION "8.22"
+#define DUMP_VERSION "8.23"
#include <my_global.h>
#include <my_sys.h>
@@ -897,8 +897,6 @@ static uint getTableStructure(char *table, char* db)
fputs(";\n", sql_file);
}
}
- if (opt_disable_keys)
- fprintf(sql_file,"\n/*!40000 ALTER TABLE %s DISABLE KEYS */;\n",table_name);
if (cFlag)
{
strpos=strmov(strpos,") VALUES ");
@@ -1023,7 +1021,7 @@ static void dumpTable(uint numFields, char *table)
strxmov(strend(query), " WHERE ",where,NullS);
}
if (!opt_xml)
- fputs("\n\n", md_result_file);
+ fputs("\n", md_result_file);
if (mysql_query(sock, query))
{
DBerror(sock, "when retrieving data from server");
@@ -1048,6 +1046,9 @@ static void dumpTable(uint numFields, char *table)
return;
}
+ if (opt_disable_keys)
+ fprintf(md_result_file,"/*!40000 ALTER TABLE %s DISABLE KEYS */;\n",
+ quote_name(table, table_buff));
if (opt_lock)
fprintf(md_result_file,"LOCK TABLES %s WRITE;\n",
quote_name(table,table_buff));
@@ -1207,11 +1208,11 @@ static void dumpTable(uint numFields, char *table)
safe_exit(EX_CONSCHECK);
return;
}
- if (opt_disable_keys)
- fprintf(md_result_file,"\n/*!40000 ALTER TABLE %s ENABLE KEYS */;\n",
- quote_name(table,table_buff));
if (opt_lock)
fputs("UNLOCK TABLES;\n", md_result_file);
+ if (opt_disable_keys)
+ fprintf(md_result_file,"/*!40000 ALTER TABLE %s ENABLE KEYS */;\n",
+ quote_name(table,table_buff));
if (opt_autocommit)
fprintf(md_result_file, "commit;\n");
mysql_free_result(res);