diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2008-11-27 18:54:23 +0400 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2008-11-27 18:54:23 +0400 |
commit | 1182c0979a5d9acc345c2cba83cac0aa32d42bca (patch) | |
tree | eae36f8fde22f68faa545501f51bd9750ed88669 /sql | |
parent | 3a3d3527a333f83eb454efa8fd1e7f34e06b578c (diff) | |
download | mariadb-git-1182c0979a5d9acc345c2cba83cac0aa32d42bca.tar.gz |
Bug#37284 Crash in Field_string::type()
The bug is repeatable with latest(1.0.1) InnoDB plugin on Linux, Win,
If MySQL is compiled with valgrind there are errors about
using of uninitialized variable(orig_table).
The fix is to set field->orig_table correct value.
mysql-test/r/innodb_mysql.result:
test result
mysql-test/t/innodb_mysql.test:
test case
sql/sql_base.cc:
set field->orig_table to 'table' value because it may be bogus and
it leads to crash on Field_string::type() function.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_base.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 873a3eac24e..881c6a421e8 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2102,7 +2102,10 @@ bool reopen_table(TABLE *table,bool locked) for (key=0 ; key < table->s->keys ; key++) { for (part=0 ; part < table->key_info[key].usable_key_parts ; part++) + { table->key_info[key].key_part[part].field->table= table; + table->key_info[key].key_part[part].field->orig_table= table; + } } if (table->triggers) table->triggers->set_table(table); |