mariadb/sql
unknown 128c3942a8 Bug#17204 "second CALL to procedure crashes Server"
Bug#18282 "INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views"
This bug caused crashes or resulted in wrong data being returned
when one tried to obtain information from I_S tables about views
using stored functions.

It was caused by the fact that we were using LEX representing
statement which were doing select from I_S tables as active LEX
when contents of I_S table were built. So state of this LEX both
affected and was affected by open_tables() calls which happened
during this process. This resulted in wrong behavior and in
violations of some of invariants which caused crashes.

This fix tries to solve this problem by properly saving/resetting
and restoring part of LEX which affects and is affected by the
process of opening tables and views in get_all_tables() routine.
To simplify things we separated this part of LEX in a new class
and made LEX its descendant.


mysql-test/r/information_schema_db.result:
  test case
mysql-test/t/information_schema_db.test:
  test case
sql/sql_lex.cc:
  To simplify saving/resetting and restoring part of LEX which
  affects and is affected by the process of opening tables and
  views we moved it to new class Query_tables_list and made LEX
  descendant of this class. Also introduced two LEX methods 
  which can be used to save and reset or to restore this state.
sql/sql_lex.h:
  To simplify saving/resetting and restoring part of LEX which
  affects and is affected by the process of opening tables and
  views we moved it to new class Query_tables_list and made LEX
  descendant of this class. Also introduced two LEX methods 
  which can be used to save and reset or to restore this state.
sql/sql_show.cc:
  Now in get_all_tables() routine we properly save/reset and
  restore part of LEX (statement table list and information
  about routines used) which affects and is affected by the
  process of opening tables and views.
sql/sql_table.cc:
  Now we clean-up LEX after opening table (view) in two stages.
  In the first stage we call LEX::cleanup_after_one_table_open()
  to clean-up selects lists and derived tables state. In the
  second stage which happens after close_thread_tables() is
  invoked we call Query_tables_list::reset_query_tables_list(FALSE)
  to rollback changes in Query_tables_list.
2006-05-30 10:45:23 +05:00
..
examples documenting HA_STATUS_xxx flags 2005-11-26 08:54:13 +01:00
share Merge mysql.com:/opt/local/work/mysql-5.0-root 2006-05-15 00:51:12 +04:00
.cvsignore
add_errmsg
client_settings.h
custom_conf.h
derror.cc
des_key_file.cc Many files: 2005-09-30 14:03:55 +02:00
discover.cc
field.cc Remove dflt_field from field structure as this was only needed when createing temporary table and I found another soultion that doesn't increase the size of the field structure for all table instances. (Better fix for bug #19089) 2006-05-24 11:56:59 +03:00
field.h Remove dflt_field from field structure as this was only needed when createing temporary table and I found another soultion that doesn't increase the size of the field structure for all table instances. (Better fix for bug #19089) 2006-05-24 11:56:59 +03:00
field_conv.cc Fix for BUG#18587: Function that accepts and returns TEXT 2006-05-10 23:16:30 +04:00
filesort.cc Move handling of suffix_length from strnxfrm_bin() to filesort to ensure proper sorting of all kind of binary objects 2005-10-14 00:04:52 +03:00
frm_crypt.cc
gen_lex_hash.cc a fix (#10742: Can't compile "sql_lex.cc" on AIX 5.2). 2005-05-19 18:56:01 +05:00
gstream.cc fixes for windows 64-bit compiler warnings 2005-06-13 12:41:15 +02:00
gstream.h
ha_archive.cc Dean noticed that constant flush calls caused the archive stream file to flush empty buffers. This patch removes that behavior. 2006-04-20 18:23:04 -07:00
ha_archive.h Dean noticed that constant flush calls caused the archive stream file to flush empty buffers. This patch removes that behavior. 2006-04-20 18:23:04 -07:00
ha_berkeley.cc BUG#6554 Problem Building MySql on Fedora Core 3 2006-01-16 12:17:30 +01:00
ha_berkeley.h Fixes during review of new code 2005-11-03 22:42:25 +02:00
ha_blackhole.cc bug#10952 2006-05-09 13:31:46 -07:00
ha_blackhole.h Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-4.1 2005-08-26 15:56:52 +03:00
ha_federated.cc Bug#17377 Federated Engine returns wrong Data, always the rows with the highest ID 2006-02-28 11:17:40 +01:00
ha_federated.h Bug#17377 Federated Engine returns wrong Data, always the rows with the highest ID 2006-02-28 11:17:40 +01:00
ha_heap.cc Manual merge 2006-03-30 17:14:55 +04:00
ha_heap.h Merge mysql.com:/opt/local/work/mysql-4.1-root 2006-02-02 18:17:18 +03:00
ha_innodb.cc Applied innodb-5.0-ss547 snapshot. 2006-05-15 18:02:21 +04:00
ha_innodb.h foo2 2006-04-13 17:22:56 +09:30
ha_myisam.cc bug #15860 (SPATIAL keys in INNODB) 2006-04-12 22:05:23 +05:00
ha_myisam.h A fix and a test case for Bug#10760 and complementary cleanups. 2005-07-19 22:21:12 +04:00
ha_myisammrg.cc bug#10952 2006-05-09 13:31:46 -07:00
ha_myisammrg.h A fix and a test case for Bug#10760 and complementary cleanups. 2005-07-19 22:21:12 +04:00
ha_ndbcluster.cc ndb - compile fix for Solaris 10 AMD64 -max GCC [ ulonglong != Uint64 ] 2006-05-25 18:00:55 +02:00
ha_ndbcluster.h Fix for Bug#17431 INSERT IGNORE INTO returns failed: 1296: err 4350 'Transaction already aborted' 2006-03-23 09:48:46 +01:00
handler.cc foo2 2006-04-13 17:22:56 +09:30
handler.h Merge acurtis@bk-internal:/home/bk/mysql-5.0-engines 2006-05-09 13:34:31 -07:00
hash_filo.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
hash_filo.h forgotten s/__GNUC__/USE_PRAGMA_INTERFACE/ causes compilation faliures 2005-05-27 14:15:08 +02:00
hostname.cc Merge mysql.com:/usr/home/ram/work/mysql-4.1 2006-03-03 15:32:00 +04:00
init.cc Fixes during review of new pushed code 2005-08-12 13:54:42 +03:00
item.cc Merge rurik.mysql.com:/home/igor/mysql-5.0 2006-05-18 11:30:42 -07:00
item.h Merge mysql.com:/home/kgeorge/mysql/5.0/clean 2006-05-25 10:45:00 +03:00
item_buff.cc sql_select.cc: 2005-07-25 12:57:23 -07:00
item_cmpfunc.cc Merge rurik.mysql.com:/home/igor/mysql-5.0 2006-05-18 11:30:42 -07:00
item_cmpfunc.h Fix compile failure on Win32 2006-04-26 01:21:33 +04:00
item_create.cc Bug#16461: connection_id() does not work properly inside trigger 2006-04-12 19:31:00 +04:00
item_create.h Fix for BUG#12335 (SP replication) : New binlogging strategy for stored PROCEDUREs/FUNCTIONs. 2005-08-25 17:34:34 +04:00
item_func.cc Fixed bug#19077: A nested materialized derived table is used before being populated. 2006-05-18 00:55:28 +04:00
item_func.h After-merge fixes; some function signatures changed from Item * to Item **. 2006-05-15 19:57:10 +02:00
item_geofunc.cc Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1 2005-10-31 11:54:36 +02:00
item_geofunc.h Merge neptunus.(none):/home/msvensson/mysql/bug10241 2005-05-09 11:26:48 +02:00
item_row.cc Merge mysql.com:/opt/local/work/mysql-4.1-16365 2006-04-12 18:30:54 +04:00
item_row.h Merge mysql.com:/opt/local/work/mysql-4.1-16365 2006-04-12 18:30:54 +04:00
item_strfunc.cc Merge mysql.com:/home/mysql-4.1-10418 2006-05-12 10:27:20 +02:00
item_strfunc.h Bug #13975: "same string" + 0 has 2 different results 2006-05-18 10:34:01 -07:00
item_subselect.cc Bug #19700: subselect returning BIGINT always returned it as SIGNED 2006-05-25 10:39:18 +03:00
item_subselect.h BUG#7549: Missing error message for invalid view selection with subquery. 2006-05-11 15:30:54 +03:00
item_sum.cc Post merge fix 2006-04-20 00:42:12 -07:00
item_sum.h Post merge fix 2006-04-20 00:42:12 -07:00
item_timefunc.cc Remove dflt_field from field structure as this was only needed when createing temporary table and I found another soultion that doesn't increase the size of the field structure for all table instances. (Better fix for bug #19089) 2006-05-24 11:56:59 +03:00
item_timefunc.h Merge mysql.com:/usr/home/bar/mysql-4.1.b18691 2006-04-17 15:01:55 +05:00
item_uniq.cc Merge with 4.1 2005-06-07 00:31:53 +03:00
item_uniq.h Inefficient usage of String::append() fixed. 2005-11-20 20:47:07 +02:00
key.cc Bug #13601: Wrong int type for bit 2006-04-04 17:54:58 -07:00
lex.h Fixed BUG#18949: Test case sp-goto is disabled 2006-04-18 11:07:34 +02:00
lex_symbol.h
lock.cc More DBUG statements 2006-05-24 17:21:35 +03:00
log.cc BUG#18116: Changed of how mutex is handled for XA and rotating binlog 2006-03-31 11:48:08 +02:00
log_event.cc BUG#18293 (Values in stored procedures written to binlog unescaped): 2006-03-21 14:35:49 +01:00
log_event.h Fixed compiler warnings from gcc 4.0.2: 2006-02-25 17:46:30 +02:00
Makefile.am Update test results for udf 2006-03-10 12:12:08 +01:00
matherr.c
mf_iocache.cc
my_decimal.cc Fix for bug #13573 (wrong data inserted for too big decimals) 2005-10-15 21:57:32 +05:00
my_decimal.h Fix for bug #13573 (wrong data inserted for too big decimals) 2005-10-15 21:57:32 +05:00
my_lock.c
mysql_priv.h Merge mysql.com:/home/kgeorge/mysql/5.0/clean 2006-05-26 11:51:30 +03:00
mysqld.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-05-26 15:00:09 -04:00
mysqld_suffix.h
net_serv.cc Make the define start at "start of line" 2006-03-02 10:55:55 +01:00
nt_servc.cc
nt_servc.h
opt_range.cc BUG#19618: post-review fixes: better comments 2006-05-16 13:39:03 +04:00
opt_range.h many warnings (practically safe but annoying) corrected 2006-01-03 17:54:54 +01:00
opt_sum.cc Remove redundant code in opt_sum_query() 2006-04-06 21:42:03 +04:00
parse_file.cc Fix for BUG#15921: DROP TRIGGER - can't be drop trigger created 2006-03-28 01:01:51 +04:00
parse_file.h Fix for BUG#15921: DROP TRIGGER - can't be drop trigger created 2006-03-28 01:01:51 +04:00
password.c Merge mysql.com:/opt/local/work/mysql-4.1-root 2006-01-11 17:49:56 +03:00
procedure.cc Merge with 4.1 2005-06-07 00:31:53 +03:00
procedure.h Merge neptunus.(none):/home/msvensson/mysql/bug10241 2005-05-09 11:26:48 +02:00
protocol.cc Fixes to embedded server to be able to run tests with it 2006-02-24 18:34:15 +02:00
protocol.h Fixes to embedded server to be able to run tests with it 2006-02-24 18:34:15 +02:00
records.cc Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1 2005-10-27 23:43:20 +03:00
repl_failsafe.cc Bug #18607: LOAD DATA FROM MASTER fails because of INFORMATION_SCHEMA database 2006-04-21 18:26:39 -07:00
repl_failsafe.h pthread_handler_decl() changed to be ctags-friendly 2005-10-08 16:39:55 +02:00
set_var.cc Bug #1039: tmpdir and datadir not available via @@ system variable syntax 2006-05-08 16:38:45 -07:00
set_var.h Bug #1039: tmpdir and datadir not available via @@ system variable syntax 2006-05-08 16:38:45 -07:00
slave.cc Bug#19938 Valgrind error (race) in handle_slave_sql() 2006-05-23 20:16:57 +02:00
slave.h many warnings (practically safe but annoying) corrected 2006-01-03 17:54:54 +01:00
sp.cc Fixed memory leak in sql_parse.cc (lex_end() was not called) 2006-05-04 15:30:38 +03:00
sp.h Fixed BUG#16303: erroneus stored procedures and functions should be droppable 2006-01-26 13:29:46 +01:00
sp_cache.cc Fix use of "%*s" *printf() specifiers that were really meant to be 2005-10-06 17:37:24 -07:00
sp_cache.h BUG#12228: Post review fixes: Added test case, code cleanup. 2005-08-10 21:17:02 +00:00
sp_head.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-05-23 15:01:05 -04:00
sp_head.h BUG#18037: Fix stack corruption in THD::rollback_item_tree_changes(). 2006-05-15 12:01:55 +02:00
sp_pcontext.cc Fixed BUG#18949: Test case sp-goto is disabled 2006-04-18 11:07:34 +02:00
sp_pcontext.h Fixed BUG#18949: Test case sp-goto is disabled 2006-04-18 11:07:34 +02:00
sp_rcontext.cc BUG#18037: Fix stack corruption in THD::rollback_item_tree_changes(). 2006-05-15 12:01:55 +02:00
sp_rcontext.h BUG#18037: Fix stack corruption in THD::rollback_item_tree_changes(). 2006-05-15 12:01:55 +02:00
spatial.cc Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0 2005-11-21 21:15:48 +02:00
spatial.h Fixed compiler warnings from gcc 4.0.2: 2006-02-25 17:46:30 +02:00
sql_acl.cc Merge mysql.com:/home/kgeorge/mysql/5.0/clean 2006-05-26 11:57:56 +03:00
sql_acl.h Reapply fix for bug#16372 (Server crashes when test 'conc_sys' is running) 2006-05-06 11:25:59 +04:00
sql_analyse.cc Porting fix that allows others to include compiled code with different parsers. 2006-03-09 10:09:52 -08:00
sql_analyse.h Merge from 4.1 2005-05-26 21:01:55 +02:00
sql_array.h Fix for BUG#12335 (SP replication) : New binlogging strategy for stored PROCEDUREs/FUNCTIONs. 2005-08-25 17:34:34 +04:00
sql_base.cc Merge mysql.com:/home/kgeorge/mysql/5.0/clean 2006-05-26 11:51:30 +03:00
sql_bitmap.h Bug#10932 - Building server with key limit of 128, makes test cases fail 2005-07-19 14:13:56 +02:00
sql_cache.cc Fixed BUG#15758: "Holding adaptive search latch in 2006-04-07 23:58:17 +04:00
sql_cache.h Fixed compiler warnings from gcc 4.0.2: 2006-02-25 17:46:30 +02:00
sql_class.cc BUG#18037: Fix stack corruption in THD::rollback_item_tree_changes(). 2006-05-15 12:01:55 +02:00
sql_class.h foo2 2006-04-13 17:22:56 +09:30
sql_client.cc
sql_crypt.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
sql_crypt.h Add ifdefs to control when "#pragma implementation" should be used 2005-05-26 12:09:14 +02:00
sql_cursor.cc Fixed BUG#15758: "Holding adaptive search latch in 2006-04-07 23:58:17 +04:00
sql_cursor.h A fix and a test case for Bug#6513 "Test Suite: Values inserted by using 2005-09-22 02:11:21 +04:00
sql_db.cc Merge aivanov@bk-internal.mysql.com:/home/bk/mysql-5.0 2006-03-01 17:43:55 +03:00
sql_delete.cc BUG#18681: View privileges are broken 2006-05-26 11:47:53 +03:00
sql_derived.cc support of view underlying tables and SP functions security check added (BUG#9505) (WL#2787) 2005-10-28 00:18:23 +03:00
sql_do.cc Name resolution context added (BUG#6443) 2005-07-01 07:05:42 +03:00
sql_error.cc Add extre DBUG_PRINT in push_warning 2006-03-16 12:06:39 +01:00
sql_error.h
sql_handler.cc Changed condition similar to code in 4.1. 2006-01-16 23:15:00 +02:00
sql_help.cc many warnings (practically safe but annoying) corrected 2006-01-03 17:54:54 +01:00
sql_insert.cc Merge mysql.com:/home/kgeorge/mysql/5.0/clean 2006-05-26 11:51:30 +03:00
sql_lex.cc Bug#17204 "second CALL to procedure crashes Server" 2006-05-30 10:45:23 +05:00
sql_lex.h Bug#17204 "second CALL to procedure crashes Server" 2006-05-30 10:45:23 +05:00
sql_list.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
sql_list.h WL#2486 - Natural/using join according to SQL:2003. 2005-11-28 21:57:50 +02:00
sql_load.cc BUG#18681: View privileges are broken 2006-05-26 11:47:53 +03:00
sql_manager.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2005-10-12 00:59:52 +03:00
sql_manager.h
sql_map.cc WL#2286 - Compile MySQL w/YASSL support 2005-06-22 14:08:28 +05:00
sql_map.h Add ifdefs to control when "#pragma implementation" should be used 2005-05-26 12:09:14 +02:00
sql_olap.cc Implementation of WL#2486 - 2005-08-12 17:57:19 +03:00
sql_parse.cc BUG#18681: View privileges are broken 2006-05-26 11:47:53 +03:00
sql_prepare.cc Post-merge fixes. 2006-05-07 16:14:43 -07:00
sql_rename.cc Fix for bug #13525 "Rename table does not keep info of triggers". 2006-02-24 23:50:36 +03:00
sql_repl.cc foo2 2006-04-13 17:22:56 +09:30
sql_repl.h
sql_select.cc Merge mysql.com:/home/kgeorge/mysql/5.0/clean 2006-05-26 11:51:30 +03:00
sql_select.h Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2006-02-27 20:00:03 +03:00
sql_show.cc Bug#17204 "second CALL to procedure crashes Server" 2006-05-30 10:45:23 +05:00
sql_sort.h
sql_state.c
sql_string.cc Merge mysql.com:/usr/home/bar/mysql-4.1.b15376 2006-03-23 12:41:28 +04:00
sql_string.h Netware specific changes. 2005-12-14 01:21:56 +02:00
sql_table.cc Bug#17204 "second CALL to procedure crashes Server" 2006-05-30 10:45:23 +05:00
sql_test.cc Post-review changes. 2006-05-03 21:35:27 -07:00
sql_trigger.cc Fix for BUG#15921: DROP TRIGGER - can't be drop trigger created 2006-03-28 01:01:51 +04:00
sql_trigger.h Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime 2006-02-26 16:38:48 +03:00
sql_udf.cc Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0 2006-03-20 21:35:05 +01:00
sql_udf.h Name resolution context added (BUG#6443) 2005-07-01 07:05:42 +03:00
sql_union.cc Post merge fixes 2006-04-21 08:19:38 -07:00
sql_update.cc BUG#18681: View privileges are broken 2006-05-26 11:47:53 +03:00
sql_view.cc Fixed wrong free in sql_view.cc 2006-05-04 22:19:31 +03:00
sql_view.h Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0 2005-11-03 16:43:05 +02:00
sql_yacc.yy Merge mysql.com:/opt/local/work/mysql-5.0-root 2006-05-15 00:51:12 +04:00
stacktrace.c
stacktrace.h
strfunc.cc
structs.h Inefficient usage of String::append() fixed. 2005-11-20 20:47:07 +02:00
table.cc Merge mysql.com:/home/kgeorge/mysql/5.0/clean 2006-05-26 11:57:56 +03:00
table.h BUG#17379 Wrong reuse of E(#rows(range)) as E(#rows(ref(const))): 2006-05-10 17:40:20 +04:00
thr_malloc.cc
time.cc Fixes during review of new pushed code 2005-07-31 12:49:55 +03:00
tzfile.h
tztime.cc Fix for bug#11081 "Using a CONVERT_TZ function in a stored function or 2006-04-24 18:57:00 +04:00
tztime.h Fix for bug#11081 "Using a CONVERT_TZ function in a stored function or 2006-04-24 18:57:00 +04:00
udf_example.cc Fix small bug in udf_example.cc, it was processing one char too much and thus returning junk 2006-04-28 11:37:20 +02:00
uniques.cc many warnings (practically safe but annoying) corrected 2006-01-03 17:54:54 +01:00
unireg.cc A fix and a test case for Bug#14210 "Simple query with > operator on 2005-11-03 14:20:13 +03:00
unireg.h Fixed bug#14169: type of group_concat() result changed to blob if tmp_table was 2006-04-12 23:05:38 +04:00
watchdog_mysqld