diff options
author | Michael Widenius <monty@askmonty.org> | 2011-10-26 20:25:18 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-10-26 20:25:18 +0300 |
commit | fa36a7426bf505e83cbd03d8e54e433b3df4d72e (patch) | |
tree | 182fd923b34d7ca56906140214c1c4730d1c47ea /storage/myisam | |
parent | 16942bc5ca0f239c2aa2c2cde4eaba144495e9aa (diff) | |
download | mariadb-git-fa36a7426bf505e83cbd03d8e54e433b3df4d72e.tar.gz |
Fixed lp:879939 "assertion in ha_maria::enable_indexes with derived_with_keys=on"
Honor unique/not unique when creating keys for internal tempory tables.
Added new variables to be used to limit how keys are created for internal temporary tables.
include/maria.h:
Added maria_max_key_length() and maria_max_key_segments()
include/myisam.h:
Added myisam_max_key_length() and myisam_max_key_segments()
mysql-test/r/mysql.result:
Drop all used tables
mysql-test/r/subselect4.result:
Added test case for lp:879939
mysql-test/t/mysql.test:
Drop all used tables
mysql-test/t/subselect4.test:
Added test case for lp:879939
sql/mysql_priv.h:
Added internal_tmp_table_max_key_length and internal_tmp_table_max_key_segments to be used to limit how keys for derived tables are created.
sql/mysqld.cc:
Added internal_tmp_table_max_key_length and internal_tmp_table_max_key_segments to be used to limit how keys for derived tables are created.
sql/share/errmsg.txt:
Added new error message for internal errors
sql/sql_select.cc:
Give error if we try to create a wrong key (this error should never happen)
Honor unique/not unique when creating keys for internal tempory tables.
storage/maria/ha_maria.cc:
Added change_table_ptr() to ensure that external_ref points always to the correct table.
(Not having this caused an assert in the included test)
storage/maria/ha_maria.h:
Added change_table_ptr() to ensure that external_ref points always to the correct table.
storage/maria/ma_check.c:
Fixed bug in Duplicate key error printing (now row position is printed correctly)
storage/maria/ma_create.c:
maria_max_key_length() -> _ma_max_key_length()
storage/maria/ma_info.c:
Added extern function maria_max_key_length() to calculate the max key length based on current block size.
storage/maria/ma_open.c:
maria_max_key_length() -> _ma_max_key_length()
storage/maria/maria_def.h:
maria_max_key_length() -> _ma_max_key_length()
storage/myisam/ha_myisam.cc:
Added change_table_ptr() to ensure that external_ref points always to the correct table.
(Not having this caused an assert in the included test)
storage/myisam/ha_myisam.h:
Added change_table_ptr() to ensure that external_ref points always to the correct table.
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/ha_myisam.cc | 8 | ||||
-rw-r--r-- | storage/myisam/ha_myisam.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index e6ad635c885..84c16caebe1 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -551,7 +551,6 @@ my_bool mi_killed_in_mariadb(MI_INFO *info) } - ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg) :handler(hton, table_arg), file(0), int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | @@ -2005,6 +2004,13 @@ int ha_myisam::delete_table(const char *name) return mi_delete_table(name); } +void ha_myisam::change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) +{ + handler::change_table_ptr(table_arg, share); + if (file) + file->external_ref= table_arg; +} + int ha_myisam::external_lock(THD *thd, int lock_type) { diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index f895a5bf449..e25cbee03e6 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -68,7 +68,7 @@ class ha_myisam: public handler uint max_supported_key_length() const { return HA_MAX_KEY_LENGTH; } uint max_supported_key_part_length() const { return HA_MAX_KEY_LENGTH; } uint checksum() const; - + void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share); int open(const char *name, int mode, uint test_if_locked); int close(void); int write_row(uchar * buf); |