summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <kaa@polly.local>2007-05-31 14:54:44 +0400
committerunknown <kaa@polly.local>2007-05-31 14:54:44 +0400
commitb6829f417363db40c3aba03ce832db27899eba61 (patch)
treec04d9c8f5ce3a42514490e40b731a75e345d2c0b /sql/sql_select.cc
parent8131c5eca4d118ee1036a26225af89ef24b182e6 (diff)
downloadmariadb-git-b6829f417363db40c3aba03ce832db27899eba61.tar.gz
Fix for bug #27643 "query failed : 1114 (The table '' is full)
Problem: HASH indexes on VARCHAR columns with binary collations did not ignore trailing spaces from strings before comparisons. This could result in duplicate records being successfully inserted into a MEMORY table with unique key constraints. As a direct consequence of the above, internal MEMORY tables used for GROUP BY calculation in testcases for bug #27643 contained duplicate rows which resulted in duplicate key errors when converting those temporary tables to MyISAM. Additionally, that error was incorrectly converted to the 'table is full' error. Solution: - ignore trailing spaces in VARCHAR fields with binary collations when calculating hashes. - return a proper error from create_myisam_from_heap() when conversion fails. mysql-test/r/ctype_ucs2_def.result: Added a testcase for bug #27643. mysql-test/r/heap_hash.result: Added a testcase for bug #27643. mysql-test/t/ctype_ucs2_def.test: Added a testcase for bug #27643. mysql-test/t/heap_hash.test: Added a testcase for bug #27643. sql/sql_select.cc: Return an appropriate error instead of 'table is full' when conversion from MEMORY to MyISAM fails. strings/ctype-bin.c: Added my_hash_sort_8bit_bin() which ignores trailing spaces when calculating hashes, and is now used for VARCHAR columns instead of my_hash_sort_bin(). strings/ctype-mb.c: Ignore trailing spaces when calculating a string hash in my_hash_sort_mb_bin(). strings/ctype-ucs2.c: Ignore trailing spaces when calculating a string hash in my_hash_sort_ucs2_bin().
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index b7ac2130784..b01212b5426 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -10112,7 +10112,7 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
err:
DBUG_PRINT("error",("Got error: %d",write_err));
- table->file->print_error(error,MYF(0)); // Give table is full error
+ table->file->print_error(write_err, MYF(0));
(void) table->file->ha_rnd_end();
(void) new_table.file->close();
err1: