mariadb/sql
Alexey Kopytov cd4ca4b7a3 Bug #55568: user variable assignments crash server when used
within query

The server could crash after materializing a derived table
which requires a temporary table for grouping.

When destroying the temporary table used to execute a query for
a derived table, JOIN::destroy() did not clean up Item_fields
pointing to fields in the temporary table. This led to
dereferencing a dangling pointer when printing out the items
tree later in the outer SELECT.

The solution is an addendum to the patch for bug37362: in
addition to cleaning up items in tmp_all_fields3, do the same
for items in tmp_all_fields1, since now we have an example
where this is necessary.


mysql-test/r/join.result:
  Added test cases for bug#55568 and a duplicate bug #54468.
mysql-test/t/join.test:
  Added test cases for bug#55568 and a duplicate bug #54468.
sql/field.cc:
  Make sure field->table_name is not set to NULL in
  Field::make_field() to avoid assertion failure in 
  Item_field::make_field() after cleaning up items
  (the assertion fired in udf.test when running
  the test suite with the patch applied).
sql/sql_select.cc:
  In addition to cleaning up items in tmp_all_fields3, do the
  same for items in tmp_all_fields1.
  Introduce a new helper function to avoid code duplication.
sql/sql_select.h:
  Introduce a new helper function to avoid code duplication in
  JOIN::destroy().
2010-08-24 14:35:48 +04:00
..
examples Bug #43414 Parenthesis (and other) warnings compiling MySQL 2009-06-17 15:54:01 +02:00
share Bug #35250: readline check breaks when doing vpath build 2010-03-09 17:51:31 +02:00
.cvsignore
add_errmsg
authors.h Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with 2010-03-17 15:10:41 +01:00
client_settings.h Bug#46013: rpl_extraColmaster_myisam fails on pb2 2009-08-13 17:07:20 -03:00
CMakeLists.txt Bug #48042 The description for Event ID ( 100 ) in Source ( MySQL ) cannot be found. 2010-04-26 23:59:50 +02:00
contributors.h
custom_conf.h
debug_sync.cc Bug #51648 DBUG_SYNC_POINT is not defined on all platforms and mtr cant pre-check that 2010-03-19 11:06:40 +02:00
debug_sync.h Bug #51648 DBUG_SYNC_POINT is not defined on all platforms and mtr cant pre-check that 2010-03-19 11:06:40 +02:00
derror.cc
des_key_file.cc
discover.cc
event_data_objects.cc Manual merge from the bugfix tree. 2010-06-11 16:52:06 +04:00
event_data_objects.h
event_db_repository.cc Bug #49132 Replication failure on temporary table + DDL 2010-01-22 17:38:21 +08:00
event_db_repository.h
event_parse_data.cc Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
event_parse_data.h
event_queue.cc
event_queue.h
event_scheduler.cc fixed various pb2 test failures on windows. 2010-02-02 14:17:21 +02:00
event_scheduler.h
events.cc Bug #50095 Multi statement including CREATE EVENT causes rotten binlog entry 2010-03-28 16:37:47 +08:00
events.h
field.cc Bug #55568: user variable assignments crash server when used 2010-08-24 14:35:48 +04:00
field.h Merging with mysql-5.1-bugteam 2010-03-17 19:15:41 +01:00
field_conv.cc Bug#48525: trigger changes "Column 'id' cannot be null" behaviour 2010-03-29 03:32:30 +01:00
filesort.cc Bug #54734 assert in Diagnostics_area::set_ok_status 2010-07-19 11:03:52 +02:00
frm_crypt.cc
gen_lex_hash.cc Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
gstream.cc Bug #43414 Parenthesis (and other) warnings compiling MySQL 2009-06-09 18:11:21 +02:00
gstream.h
ha_ndbcluster.cc Bug#51591 deadlock in the plugins+status+variables 2010-04-19 15:48:37 +02:00
ha_ndbcluster.h
ha_ndbcluster_binlog.cc Bug #40877: multi statement execution fails in 5.1.30 2009-10-16 13:29:42 +03:00
ha_ndbcluster_binlog.h
ha_ndbcluster_cond.cc
ha_ndbcluster_cond.h
ha_ndbcluster_tables.h
ha_partition.cc Bug#52455: Subpar INSERT ON DUPLICATE KEY UPDATE performance with many partitions 2010-07-09 01:09:31 +02:00
ha_partition.h merge 2010-07-09 15:00:33 +02:00
handler.cc BUG#39053 - UNISTALL PLUGIN does not allow the storage engine 2010-04-14 13:53:59 +04:00
handler.h merge 2010-07-09 15:00:33 +02:00
hash_filo.cc
hash_filo.h
hostname.cc
init.cc
item.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-20 15:07:36 -03:00
item.h Bug #55188: GROUP BY, GROUP_CONCAT and TEXT - inconsistent results 2010-07-30 16:35:06 +03:00
item_buff.cc Bug #55188: GROUP BY, GROUP_CONCAT and TEXT - inconsistent results 2010-07-30 16:35:06 +03:00
item_cmpfunc.cc Automerge. 2010-06-24 15:26:14 +04:00
item_cmpfunc.h 5.0-bugteam->5.1-bugteam merge 2010-06-08 10:28:30 +04:00
item_create.cc Bug#53445: Build with -Wall and fix warnings that it generates 2010-07-02 15:30:47 -03:00
item_create.h Bug #49829 Many "hides virtual function" warnings with 2010-03-14 17:01:45 +01:00
item_func.cc Bug #55615 and bug #55564 2010-08-13 14:18:46 +03:00
item_func.h Bug #55615 and bug #55564 2010-08-13 14:18:46 +03:00
item_geofunc.cc Manual merge of the fix for bug#43668. 2009-11-24 18:26:13 +03:00
item_geofunc.h
item_row.cc Bug#51598 Inconsistent behaviour with a COALESCE statement inside an IN comparison 2010-03-19 10:21:37 +04:00
item_row.h Bug#51598 Inconsistent behaviour with a COALESCE statement inside an IN comparison 2010-03-19 10:21:37 +04:00
item_strfunc.cc Bug#50373 --secure-file-priv="" 2010-05-03 18:14:39 +02:00
item_strfunc.h fixed compiler warning 2010-03-29 18:42:49 +05:00
item_subselect.cc Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:45:22 -03:00
item_subselect.h Bug#52120 create view cause Assertion failed: 0, file .\item_subselect.cc, line 817 2010-04-06 12:26:59 +05:00
item_sum.cc Bug #54476: crash when group_concat and 'with rollup' in 2010-07-23 15:52:54 +04:00
item_sum.h Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:45:22 -03:00
item_timefunc.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-09 09:00:17 -03:00
item_timefunc.h Bug #42849: innodb crash with varying time_zone on partitioned 2009-12-13 23:29:50 +03:00
item_xmlfunc.cc Bug#34384: Slow down on constant conversion. 2009-11-06 22:34:25 +03:00
item_xmlfunc.h
key.cc
lex.h Bug#45829 "CREATE TABLE TRANSACTIONAL PAGE_CHECKSUM ROW_FORMAT=PAGE accepted, does nothing": 2009-07-29 10:54:20 +02:00
lex_symbol.h
lock.cc Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
log.cc BUG#55625 RBR breaks on failing 'CREATE TABLE' 2010-08-02 20:48:56 +01:00
log.h BUG#55625 RBR breaks on failing 'CREATE TABLE' 2010-08-02 20:48:56 +01:00
log_event.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-09 09:00:17 -03:00
log_event.h The following statements support the CURRENT_USER() where a user is needed. 2010-07-04 12:02:49 +08:00
log_event_old.cc Bug#53445: Build with -Wall and fix warnings that it generates 2010-07-02 15:30:47 -03:00
log_event_old.h
Makefile.am WL#4259 - Debug Sync Facility 2009-09-29 17:38:40 +02:00
message.h
message.mc
message.rc
mf_iocache.cc
MSG00001.bin
my_decimal.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-09 09:00:17 -03:00
my_decimal.h Bug#48370: Absolutely wrong calculations with GROUP BY and decimal fields when using IF 2009-11-02 09:21:39 -02:00
my_lock.c
mysql_priv.h BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave 2010-07-29 11:00:57 +08:00
mysql_priv.h.pp Bug#47857 strip_sp function in mysys/mf_strip.c never used and cause name clash 2009-10-06 13:04:51 +02:00
mysqld.cc Automerge. 2010-07-21 14:14:11 +04:00
mysqld_suffix.h
net_serv.cc Merge 2010-06-09 11:29:27 +03:00
nt_servc.cc
nt_servc.h
opt_range.cc Manual merge. 2010-07-15 17:01:44 +04:00
opt_range.h Bug #54734 assert in Diagnostics_area::set_ok_status 2010-07-19 11:03:52 +02:00
opt_sum.cc Bug#53859: Valgrind: opt_sum_query(TABLE_LIST*, List<Item>&, 2010-06-11 09:38:29 +02:00
parse_file.cc Bug#44834 strxnmov is expected to behave as you'd expect 2009-06-19 13:24:43 +05:00
parse_file.h Bug#43385 Cannot ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME when Views exist(addon) 2009-04-13 18:09:10 +05:00
partition_element.h
partition_info.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-20 15:07:36 -03:00
partition_info.h fixed a valgrind warning in partition_pruning 2009-09-02 18:42:08 +03:00
password.c Manual merge. 2009-06-01 16:00:38 +04:00
procedure.cc
procedure.h
protocol.cc Merge 5.1-bugteam -> 5.1-bug-42496 2010-07-23 18:15:56 +07:00
protocol.h Bug#44521 Executing a stored procedure as a prepared statement can sometimes cause 2009-07-29 22:07:08 +02:00
records.cc A fix and a test case for 2009-11-03 20:45:52 +03:00
repl_failsafe.cc BUG#53657: Slave crashed with error 22 when trying to lock mutex 2010-05-24 17:43:27 +01:00
repl_failsafe.h
rpl_constants.h BUG#40482: server/mysqlbinlog crashes when reading invalid Incident_log_event 2008-12-29 17:04:10 +01:00
rpl_filter.cc A patch for Bug#45118 (mysqld.exe crashed in debug mode 2009-09-10 11:40:57 +04:00
rpl_filter.h
rpl_injector.cc Fix for compiler warnings: 2010-01-28 19:51:40 -02:00
rpl_injector.h
rpl_mi.cc BUG#53657: Slave crashed with error 22 when trying to lock mutex 2010-05-24 17:43:27 +01:00
rpl_mi.h BUG#53657: Slave crashed with error 22 when trying to lock mutex 2010-05-24 17:43:27 +01:00
rpl_record.cc Fix for compiler warnings: 2010-01-28 19:51:40 -02:00
rpl_record.h BUG#48091 valgrind errors when slave has double not null and master has double null 2009-10-22 01:15:45 +01:00
rpl_record_old.cc
rpl_record_old.h
rpl_reporting.cc BUG#45511 rpl.rpl_binlog_corruption fails with warning messages in Valgrind 2009-06-16 16:04:30 +01:00
rpl_reporting.h BUG#45511 rpl.rpl_binlog_corruption fails with warning messages in Valgrind 2009-06-16 16:04:30 +01:00
rpl_rli.cc Bug#53445: Build with -Wall and fix warnings that it generates 2010-07-02 15:30:47 -03:00
rpl_rli.h merging 5.0-bt -> 5.1-bt to local branch with bug@47210 2009-12-14 18:32:22 +02:00
rpl_tblmap.cc Bug#45613 handle failures from my_hash_insert 2009-11-20 16:18:01 +01:00
rpl_tblmap.h
rpl_utility.cc BUG#49618: Field length stored incorrectly in binary log 2010-03-17 15:28:49 +01:00
rpl_utility.h Merging with mysql-5.1-bugteam 2010-03-17 19:15:41 +01:00
scheduler.cc
scheduler.h
set_var.cc Bug#53445: Build with -Wall and fix warnings that it generates 2010-07-02 15:30:47 -03:00
set_var.h Bug#53445: Build with -Wall and fix warnings that it generates 2010-07-02 15:30:47 -03:00
slave.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-20 15:07:36 -03:00
slave.h Bug #47210 first execution of "start slave until" stops too early 2009-11-12 17:10:19 +02:00
sp.cc Manual merge from the bugfix tree. 2010-06-11 16:52:06 +04:00
sp.h Bug#45613 handle failures from my_hash_insert 2009-11-20 16:18:01 +01:00
sp_cache.cc Bug#50624: crash in check_table_access during call procedure 2010-02-13 08:35:14 -02:00
sp_cache.h
sp_head.cc Bug#53191 Lock_time in slow log is negative when logging stored routines 2010-06-08 10:58:19 +02:00
sp_head.h Bug#50755: Crash if stored routine def contains version comments 2010-04-01 10:15:22 -03:00
sp_pcontext.cc merging 2009-04-29 07:59:10 +05:00
sp_pcontext.h Manual merge. 2009-12-18 16:44:24 -02:00
sp_rcontext.cc Bug#34384: Slow down on constant conversion. 2009-11-06 22:34:25 +03:00
sp_rcontext.h
spatial.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-20 15:07:36 -03:00
spatial.h Bug#42733: Type-punning warnings when compiling MySQL -- 2010-07-14 16:39:40 -03:00
sql_acl.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-20 15:07:36 -03:00
sql_acl.h Bug#41726: upgrade from 5.0 to 5.1.30 crashes if you didn't run mysql_upgrade 2009-11-21 09:18:21 -02:00
sql_analyse.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-09 09:00:17 -03:00
sql_analyse.h
sql_array.h
sql_base.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-20 15:07:36 -03:00
sql_binlog.cc Fix for bug #54393: crash and/or valgrind errors in 2010-06-18 21:32:23 +04:00
sql_bitmap.h
sql_builtin.cc.in
sql_cache.cc Fixed bug #42496 - the server could crash on a debug assert after a failure 2010-07-21 14:56:43 +07:00
sql_cache.h Bug#39253 Large query cache still freezes server after fix for bug #21074 2009-11-20 13:49:06 +01:00
sql_class.cc Merge 5.1-bugteam -> 5.1-bug-42496 2010-07-23 18:15:56 +07:00
sql_class.h Bug #53493 : add_to_status does not handle the longlong fields in STATUS_VAR 2010-07-14 11:50:17 +03:00
sql_client.cc
sql_connect.cc Fix for bug #53912: Fails to build from source 2010-06-04 21:58:41 +04:00
sql_crypt.cc Bug#49141: Encode function is significantly slower in 5.1 compared to 5.0 2009-12-04 13:36:58 -02:00
sql_crypt.h Bug#49141: Encode function is significantly slower in 5.1 compared to 5.0 2009-12-04 13:36:58 -02:00
sql_cursor.cc Fixed bug #42496 - the server could crash on a debug assert after a failure 2010-07-21 14:56:43 +07:00
sql_cursor.h
sql_db.cc Bug #54360 Deadlock DROP/ALTER/CREATE DATABASE with open HANDLER 2010-06-26 19:36:00 +02:00
sql_delete.cc Bug #54734 assert in Diagnostics_area::set_ok_status 2010-07-19 11:03:52 +02:00
sql_derived.cc Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:45:22 -03:00
sql_do.cc
sql_error.cc Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
sql_error.h
sql_handler.cc Fix for bug #54007: assert in ha_myisam::index_next, HANDLER 2010-06-09 14:45:04 +04:00
sql_help.cc Merge from 5.0-bugteam 2009-06-17 16:56:44 +02:00
sql_insert.cc BUG#55625 RBR breaks on failing 'CREATE TABLE' 2010-08-02 20:48:56 +01:00
sql_lex.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-30 17:33:10 -03:00
sql_lex.h BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave 2010-07-29 11:00:57 +08:00
sql_list.cc
sql_list.h Fix somewhat bogus GCC warning. Although needless as the base 2010-07-03 10:20:05 -03:00
sql_load.cc Revert patch for BUG#34283. Causing lots of test failures in PB2, 2010-07-30 14:44:39 +01:00
sql_locale.cc Bug#43207 wrong LC_TIME names for romanian locale 2009-10-19 13:41:52 +05:00
sql_manager.cc Bug#38522: 5 seconds delay when closing application using embedded server 2008-12-04 19:41:53 +01:00
sql_map.cc
sql_map.h
sql_olap.cc Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:45:22 -03:00
sql_parse.cc BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave 2010-07-29 11:00:57 +08:00
sql_partition.cc BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave 2010-07-29 11:00:57 +08:00
sql_partition.h BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave 2010-07-29 11:00:57 +08:00
sql_plugin.cc Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:16:43 -03:00
sql_plugin.h Bug#19027 MySQL 5.0 starts even with Fatal InnoDB errors 2009-05-14 14:03:33 +02:00
sql_prepare.cc Bug#54041: MySQL 5.0.92 fails when tests from Connector/C suite run 2010-07-30 09:17:10 -03:00
sql_profile.cc Bug #49829 Many "hides virtual function" warnings with 2010-03-14 17:01:45 +01:00
sql_profile.h Backport WL#3653 to 5.1 to enable bundled innodb plugin. 2009-06-10 10:59:49 +02:00
sql_rename.cc Backport Bug#37148 to 5.1 2010-01-24 15:03:23 +08:00
sql_repl.cc merged BUG#55322 to 5.1-bugteam 2010-07-26 11:56:30 +02:00
sql_repl.h
sql_select.cc Bug #55568: user variable assignments crash server when used 2010-08-24 14:35:48 +04:00
sql_select.h Bug #55568: user variable assignments crash server when used 2010-08-24 14:35:48 +04:00
sql_servers.cc Bug#33982 debug assertion and crash reloading grant tables after sighup or kill 2010-01-13 12:39:00 +01:00
sql_servers.h
sql_show.cc Merge 2010-07-22 11:17:26 -05:00
sql_show.h
sql_sort.h
sql_state.c
sql_string.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-09 09:00:17 -03:00
sql_string.h Bug #55424: convert_tz crashes when fed invalid data 2010-08-06 23:29:37 +04:00
sql_table.cc merge 2010-07-21 18:54:11 +03:00
sql_tablespace.cc Backport Bug#37148 to 5.1 2010-01-24 15:03:23 +08:00
sql_test.cc Bug #50271: Debug output of JOIN structures is garbled 2010-01-28 12:10:57 +01:00
sql_trigger.cc Manual merge from the bugfix tree. 2010-06-11 16:52:06 +04:00
sql_trigger.h Fix for 2009-01-14 18:50:51 +04:00
sql_udf.cc Manual merge with Conflicts: 2010-01-25 10:55:05 +08:00
sql_udf.h
sql_union.cc Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:45:22 -03:00
sql_update.cc Bug #54734 assert in Diagnostics_area::set_ok_status 2010-07-19 11:03:52 +02:00
sql_view.cc Manual merge from the bugfix tree. 2010-06-11 16:52:06 +04:00
sql_view.h Bug#43385 Cannot ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME when Views exist(addon) 2009-04-13 18:09:10 +05:00
sql_yacc.yy Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:45:22 -03:00
strfunc.cc Bug #43414 Parenthesis (and other) warnings compiling MySQL 2009-09-23 15:21:29 +02:00
structs.h A fix and a test case for 2009-11-03 20:45:52 +03:00
table.cc Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-20 15:07:36 -03:00
table.h merge mysql-5.1-bugteam into mysql-5.1-security 2010-08-02 10:50:15 +03:00
thr_malloc.cc Bug #42064: low memory crash when importing hex strings, in 2010-05-21 15:23:48 +04:00
time.cc Bug#47925: regression of range optimizer and date comparison in 5.1.39! 2009-11-02 13:24:07 +01:00
tzfile.h
tztime.cc Bug #55424: convert_tz crashes when fed invalid data 2010-08-06 23:29:37 +04:00
tztime.h Backport of a 5.0.74 fix into 5.0.72sp1: 2009-01-12 17:40:29 +01:00
udf_example.c Bug#45288: pb2 returns a lot of compilation warnings on linux 2010-07-20 15:07:36 -03:00
udf_example.def
uniques.cc Merge from 5.0-bugteam 2009-06-17 16:56:44 +02:00
unireg.cc Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:16:43 -03:00
unireg.h Bug#53445: Build with -Wall and fix warnings that it generates 2010-07-02 15:30:47 -03:00