mariadb/sql
Georgi Kodinov 4d2f047e95 Bug #41610: key_infix_len can be overwritten causing some group by queries to
return no rows

The algorithm of determining the best key for loose index scan is doing a loop
over the available indexes and selects the one that has the best cost.
It retrieves the parameters of the current index into a set of variables.
If the cost of using the current index is lower than the best cost so far it 
copies these variables into another set of variables that contain the 
information for the best index so far.
After having checked all the indexes it uses these variables (outside of the 
index loop) to create the table read plan object instance.
The was a single omission : the key_infix/key_infix_len variables were used 
outside of the loop without being preserved in the loop for the best index 
so far.
This causes these variables to get overwritten by the next index(es) checked.
Fixed by adding variables to hold the data for the current index, passing 
the new variables to the function that assigns values to them and copying 
the new variables into the existing ones when selecting a new current best 
index.
To avoid further such problems moved the declarations of the variables used 
to keep information about the current index inside the loop's compound 
statement.
2009-02-27 15:25:06 +02:00
..
examples Bug#39616: Missing quotes from .CSV crashes server 2008-11-18 11:31:03 +05:30
share Bug#28323: Server crashed in xid cache operations 2008-10-21 15:45:43 -02:00
.cvsignore
add_errmsg
client_settings.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
CMakeLists.txt Bug#40280: Message compiler(mc.exe) needed to compile MySQL on windows. 2008-10-23 15:28:53 +02:00
custom_conf.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
derror.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
des_key_file.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
discover.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
field.cc Added a missing bit from the original patch for bug #27483 which was lost when re-applying 2008-12-09 13:19:46 +03:00
field.h Bug#38469 invalid memory read and/or crash with utf8 text field, stored procedure, uservar 2008-09-20 10:51:03 +02:00
field_conv.cc field_conv.cc: 2007-07-12 00:55:40 +05:00
filesort.cc BUG#35478: sort_union() returns bad data when sort_buffer_size is hit 2008-07-15 18:13:21 +04:00
frm_crypt.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
gen_lex_hash.cc gen_lex_hash.cc: 2007-01-31 00:06:42 +01:00
gstream.cc Merge mysql.com:/home/hf/work/30286/my41-30286 2007-10-05 16:33:08 +05:00
gstream.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
ha_archive.cc BUG#29207 - archive table reported as corrupt by check table (P1) 2007-06-27 13:19:34 +05:00
ha_archive.h Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2007-01-22 14:04:40 +02:00
ha_berkeley.cc fixes for warnings and compile errors for the fix of bug 26243 2008-03-29 16:12:23 +02:00
ha_berkeley.h Fixed compiler warnings (for linux and win32 and win64) 2007-02-22 16:59:57 +02:00
ha_blackhole.cc Bug #35178 INSERT_ID not written to binary log for inserts against BLACKHOLE backed tables 2008-03-19 18:44:50 +02:00
ha_blackhole.h Bug#30294 blackhole engine causes 100% with 2 alter table statements running 2007-11-16 14:46:36 +04:00
ha_federated.cc Fix for bug#40875: Memory leak in FEDERATED handler 2008-11-20 14:08:36 +04:00
ha_federated.h Bug #32374 crash with filesort when selecting from federated table and view. 2007-11-30 17:08:00 +04:00
ha_heap.cc type conversions fixed to get rid of warnings 2007-10-23 16:32:05 +05:00
ha_heap.h [pb problem]: ha_heap->clone() fails on windows because of mess with 2007-07-17 19:51:50 +04:00
ha_innodb.cc merging. 2009-02-24 15:22:37 +04:00
ha_innodb.h Bug #20358: InnoDB hang on the adaptive hash index latch in btr0sea.c 2007-10-02 23:47:30 -06:00
ha_myisam.cc Bug#33756 - query cache with concurrent_insert=0 appears broken 2008-03-13 16:39:27 +01:00
ha_myisam.h Bug#28249 Query Cache returns wrong result with concurrent insert / certain lock 2007-07-12 13:29:51 +02:00
ha_myisammrg.cc Merge amd64.(none):/src/mysql-5.0-bugteam 2008-03-28 16:01:05 -04:00
ha_myisammrg.h BUG#26976 - Missing table in merge not noted in related error msg + 2007-06-06 04:42:41 +05:00
ha_ndbcluster.cc fixed warnings and compile errors from the fix for bug 26243 2008-03-29 09:52:16 +02:00
ha_ndbcluster.h ha_ndbcluster.h: 2007-11-05 20:18:22 +01:00
ha_ndbcluster_cond.cc fixed warnings and compile errors from the fix for bug 26243 2008-03-29 09:52:16 +02:00
ha_ndbcluster_cond.h Bug#34749: Server crash when using NAME_CONST() with an aggregate function 2008-02-28 14:23:22 +01:00
handler.cc Fix for bug#40984: backport fix from 39585 into 5.0 2008-11-25 10:22:02 +04:00
handler.h Fix for bug#40984: backport fix from 39585 into 5.0 2008-11-25 10:22:02 +04:00
hash_filo.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
hash_filo.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
hostname.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
init.cc Bug#26294: library name conflict between MySQL 4.x, 5.0 and Qt 3.3 2008-04-03 11:32:00 -04:00
item.cc fixed a warning 2009-02-20 11:42:35 +02:00
item.h Bug#37601 Cast Is Not Done On Row Comparison 2009-02-19 17:20:44 +04:00
item_buff.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
item_cmpfunc.cc Bug#37601 Cast Is Not Done On Row Comparison 2009-02-19 17:20:44 +04:00
item_cmpfunc.h rollback of bug #40761 fix 2008-12-12 14:59:10 +04:00
item_create.cc Fix mismerge. 2008-04-10 15:55:37 -04:00
item_create.h Bug #27921 View ignores precision for CAST() 2007-05-10 00:17:21 +05:00
item_func.cc BUG#36737 - having + full text operator crashes mysql 2009-02-12 13:49:44 +04:00
item_func.h auto merge 2009-01-16 16:48:41 +02:00
item_geofunc.cc Merge mysql.com:/home/hf/work/31158/my41-31158 2007-11-17 16:48:57 +04:00
item_geofunc.h Bug #31155 gis types in union'd select cause crash. 2007-10-04 12:01:28 +05:00
item_row.cc Many files: 2006-12-23 20:17:15 +01:00
item_row.h Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2007-01-22 14:04:40 +02:00
item_strfunc.cc Bug #41437: Value stored in 'case' lacks charset, causes segfault 2009-01-09 13:50:18 +02:00
item_strfunc.h bug#35558 Wrong server metadata blows up the client 2008-12-09 14:00:43 +04:00
item_subselect.cc Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-bugteam 2008-03-28 14:31:52 +03:00
item_subselect.h Bug #31884: Assertion + crash in subquery in the SELECT clause. 2007-10-30 14:27:21 +02:00
item_sum.cc backported the fix for bug #34773 to 5.0 2008-12-09 20:35:02 +02:00
item_sum.h backported the fix for bug #34773 to 5.0 2008-12-09 20:35:02 +02:00
item_timefunc.cc Bug#37575 UCASE fails on monthname 2008-12-23 18:08:04 +04:00
item_timefunc.h Bug#42525: TIMEDIFF function 2009-02-06 18:25:08 +01:00
item_uniq.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
item_uniq.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
key.cc Fixed bug #32556: assert in "using index for group-by" : 2007-11-21 22:56:42 +04:00
lex.h Fix -ansi -pedantic warning (can't cast a pointer to function 2007-03-08 12:04:45 +03:00
lex_symbol.h Fix -ansi -pedantic warning (can't cast a pointer to function 2007-03-08 12:04:45 +03:00
lock.cc fixed warnings from the fix of 26243 2008-03-29 17:50:46 +02:00
log.cc Fix PB warnings for parenthesis and valgrind leak report. 2008-12-11 11:06:50 +00:00
log_event.cc fixing compilation warning and adding flush logs to test of bug#37313 2009-02-24 16:17:34 +02:00
log_event.h Bug #27571 asynchronousity in setting mysql_query::error and 2007-10-29 15:20:59 +02:00
Makefile.am Bug#40280: Message compiler(mc.exe) needed to compile MySQL on windows. 2008-10-23 15:28:53 +02:00
matherr.c my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
message.h Bug#40280: Message compiler(mc.exe) needed to compile MySQL on windows. 2008-10-23 15:28:53 +02:00
message.mc Bug#40280: Message compiler(mc.exe) needed to compile MySQL on windows. 2008-10-23 15:28:53 +02:00
message.rc Bug#40280: Message compiler(mc.exe) needed to compile MySQL on windows. 2008-10-23 15:28:53 +02:00
mf_iocache.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
MSG00001.bin Bug#40280: Message compiler(mc.exe) needed to compile MySQL on windows. 2008-10-23 15:28:53 +02:00
my_decimal.cc Bug#37553: MySql Error Compare TimeDiff & Time 2008-11-26 09:28:17 +01:00
my_decimal.h Bug#36023: Incorrect handling of zero length caused an assertion to fail. 2008-04-25 00:39:37 +04:00
my_lock.c my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
mysql_priv.h Bug#36326: nested transaction and select 2009-01-13 20:07:06 -02:00
mysqld.cc Fixed a build failure on Ubuntu 8.10 introduced by the patch 2009-02-25 10:36:11 +02:00
mysqld_suffix.h Many files: 2006-12-23 20:17:15 +01:00
net_serv.cc Bug#26243 mysql command line crash after control-c 2008-03-28 14:02:27 -04:00
nt_servc.cc Bug #20430 mysqld.exe windows service stuck in "SERVICE_STOP_PENDING" 2008-11-14 02:01:41 +01:00
nt_servc.h Bug #20430 mysqld.exe windows service stuck in "SERVICE_STOP_PENDING" 2008-11-14 02:01:41 +01:00
opt_range.cc Bug #41610: key_infix_len can be overwritten causing some group by queries to 2009-02-27 15:25:06 +02:00
opt_range.h BUG#36639: subselect.test crashes on 64 bit pentium4 when compiled for valgrind, commit into 5.0 2008-08-25 21:02:54 +04:00
opt_sum.cc backported the fix for bug #34773 to 5.0 2008-12-09 20:35:02 +02:00
parse_file.cc Merge from dev tree. 2009-01-14 11:15:11 -05:00
parse_file.h Bug #40021: Renaming view fails, archived .frm for view is 2008-11-14 21:25:57 +04:00
password.c Merge bk-internal.mysql.com:/home/bk/mysql-5.0 2007-01-22 14:04:40 +02:00
procedure.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
procedure.h Bug #26461: Intrinsic data type bool (1 byte) redefined to BOOL (4 bytes) 2008-03-21 17:23:17 +02:00
protocol.cc Fix for bug#19829:make test Failed in mysql_client_test 2009-02-26 12:34:15 +04:00
protocol.h Backport of TIME->MYSQL_TIME / Y2K fixset 2007-05-16 10:44:59 +02:00
records.cc BUG#35478: sort_union() returns bad data when sort_buffer_size is hit 2008-07-15 18:13:21 +04:00
repl_failsafe.cc Make gcov happy. 2008-03-18 16:38:12 +04:00
repl_failsafe.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
set_var.cc Bug#41456 SET PASSWORD hates CURRENT_USER() 2008-12-24 19:14:59 +04:00
set_var.h Bug #37339: SHOW VARIABLES not working properly with multi-byte datadir 2008-11-28 16:25:16 +02:00
slave.cc Merge amd64.(none):/src/mysql-5.0-bugteam 2008-03-28 16:01:05 -04:00
slave.h BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if 2008-02-22 19:07:07 +04:00
sp.cc Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on 2008-07-14 15:41:30 -06:00
sp.h Many files: 2006-12-23 20:17:15 +01:00
sp_cache.cc Many files: 2006-12-23 20:17:15 +01:00
sp_cache.h Many files: 2006-12-23 20:17:15 +01:00
sp_head.cc merge 2008-10-02 13:10:06 +05:00
sp_head.h Bug#26030 (Parsing fails for stored routine w/multi-statement execution 2008-07-07 10:00:08 -06:00
sp_pcontext.cc Bug#26503 (Illegal SQL exception handler code causes the server to crash) 2007-03-14 12:02:32 -06:00
sp_pcontext.h Bug#26503 (Illegal SQL exception handler code causes the server to crash) 2007-03-14 12:02:32 -06:00
sp_rcontext.cc Bug#33618 (Crash in sp_rcontext) 2008-01-23 13:26:41 -07:00
sp_rcontext.h Bug#33618 (Crash in sp_rcontext) 2008-01-23 13:26:41 -07:00
spatial.cc Bug #29166: 2007-07-05 18:24:48 +03:00
spatial.h Bug #24563: MBROverlaps does not seem to function propertly. 2007-03-23 16:28:07 -06:00
sql_acl.cc Bug #41354: Access control is bypassed when all columns 2009-02-26 19:00:44 +02:00
sql_acl.h Bug #26461: Intrinsic data type bool (1 byte) redefined to BOOL (4 bytes) 2008-03-21 17:23:17 +02:00
sql_analyse.cc fixed warnings from the fix of 26243 2008-03-29 17:50:46 +02:00
sql_analyse.h Bug #26461: Intrinsic data type bool (1 byte) redefined to BOOL (4 bytes) 2008-03-21 17:23:17 +02:00
sql_array.h Fix for bug #31207: Test "join_nested" shows different strategy on IA64 2007-10-17 20:08:58 +04:00
sql_base.cc Bug #41354: Access control is bypassed when all columns 2009-02-26 19:00:44 +02:00
sql_bitmap.h Many files: 2006-12-23 20:17:15 +01:00
sql_cache.cc Bug#40264: Aborted cached query causes query to hang indefinitely on next cache hit 2009-01-22 08:28:01 -02:00
sql_cache.h Bug#30087 Set query_cache_size, if the value is too small, get a unclear warning 2008-07-16 16:29:22 -06:00
sql_class.cc Fix for bug #41868: crash or memory overrun with concat + upper, 2009-02-10 15:38:56 +03:00
sql_class.h BUG#38826 Race in MYSQL_LOG::purge_logs is impossible to debug in production 2008-12-04 01:01:03 +00:00
sql_client.cc Bug#26664 test suite times out on OS X 64bit 2007-05-24 11:21:27 +02:00
sql_crypt.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sql_crypt.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sql_cursor.cc Bug#37956 memory leak and / or crash with geometry and prepared statements! 2008-12-10 18:13:11 +04:00
sql_cursor.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sql_db.cc Bug #40021: Renaming view fails, archived .frm for view is 2008-11-14 21:25:57 +04:00
sql_delete.cc BUG#35478: sort_union() returns bad data when sort_buffer_size is hit 2008-07-15 18:13:21 +04:00
sql_derived.cc - renaming TMP_TABLE to NON_TRANSACTIONAL_TMP_TABLE because this is 2007-03-22 15:07:32 +01:00
sql_do.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sql_error.cc Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime 2007-06-20 12:46:15 +04:00
sql_error.h BUG#26976 - Missing table in merge not noted in related error msg + 2007-06-06 04:42:41 +05:00
sql_handler.cc Bug#41110: crash with handler command when used concurrently with alter table 2009-02-24 10:15:21 +01:00
sql_help.cc BUG#35478: sort_union() returns bad data when sort_buffer_size is hit 2008-07-15 18:13:21 +04:00
sql_insert.cc Bug #38693: leaked memory with blobs! 2008-10-15 16:55:52 +03:00
sql_lex.cc Bug#37075: offset of limit clause might be truncated on 32-bits server w/o big tables 2008-10-15 18:34:51 -03:00
sql_lex.h Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while 2008-10-08 02:34:00 +05:00
sql_list.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sql_list.h Bug#38296 (low memory crash with many conditions in a query) 2008-08-11 10:10:00 -06:00
sql_load.cc Bug#37114: sql_mode NO_BACKSLASH_ESCAPES does not work properly with LOAD DATA INFILE 2008-09-17 08:34:00 +02:00
sql_locale.cc Bug#37575 UCASE fails on monthname 2008-12-23 18:08:04 +04:00
sql_manager.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sql_manager.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sql_map.cc type conversions fixed to avoid warnings on Windows 2007-10-23 14:27:11 +05:00
sql_map.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sql_olap.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sql_parse.cc Bug #35396: Abnormal query times in slow query log 2009-01-29 14:40:48 +02:00
sql_prepare.cc Bug#35577 (CREATE PROCEDURE causes either crash or syntax error depending on 2008-07-14 15:41:30 -06:00
sql_rename.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sql_repl.cc Fixes to make code compile on Windows. 2008-01-31 07:19:29 +01:00
sql_repl.h BUG#31024: STOP SLAVE does not stop attempted connect()s 2008-03-11 14:42:54 +01:00
sql_select.cc Bug #42419: Server crash with "Pure virtual method called" on two concurrent 2009-02-19 17:30:03 +02:00
sql_select.h Bug #42037: Queries containing a subquery with DISTINCT and 2009-02-05 13:30:39 +04:00
sql_show.cc Bug#40345 MySQLDump prefixes view name with database name when view references other db 2009-02-25 15:44:50 +04:00
sql_sort.h Fixed bug #25798. 2007-07-01 15:33:28 -07:00
sql_state.c Many files: 2006-12-23 20:17:15 +01:00
sql_string.cc Merge from dev tree. 2009-02-14 12:09:35 +03:00
sql_string.h Bug#38296 (low memory crash with many conditions in a query) 2008-08-11 10:10:00 -06:00
sql_table.cc Bug#31291 ALTER TABLE CONVERT TO CHARACTER SET does not change some data types 2008-12-09 16:38:52 +04:00
sql_test.cc my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sql_trigger.cc Bug #40021: Renaming view fails, archived .frm for view is 2008-11-14 21:25:57 +04:00
sql_trigger.h A fix and a test case for Bug#26141 mixing table types in trigger 2007-07-12 22:26:41 +04:00
sql_udf.cc Bug#37428 Potential security issue with UDFs - linux shellcode execution. 2008-08-25 17:11:59 +05:00
sql_udf.h Remove typedef st_table_list TABLE_LIST and always use name 'TABLE_LIST'. 2007-07-06 16:18:49 +04:00
sql_union.cc Bug#38499: flush tables and multitable table update with 2008-10-09 20:24:31 +05:00
sql_update.cc Bug#37460 Assertion failed: !table->file || table->file->inited == handler::NONE 2008-11-27 17:57:34 +04:00
sql_view.cc After-push commit for bug #33461 to make valgrind happy: 2008-12-01 12:14:02 +04:00
sql_view.h Bug#32890 Crash after repeated create and drop of tables and views 2008-02-21 14:58:29 -03:00
sql_yacc.yy Bug #33813: Schema names are case-sensitive in DROP FUNCTION 2009-02-12 16:36:43 +02:00
stacktrace.c Bug#35987 - post-review fix 2008-09-16 13:16:41 +02:00
stacktrace.h Bug#31745 - crash handler does not work on Windows 2008-02-19 12:37:39 +01:00
strfunc.cc Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
structs.h Bug#41131 "Questions" fails to increment - ignores statements instead stored procs(5.0 ver) 2008-12-29 16:06:53 +04:00
table.cc Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while 2008-10-08 02:34:00 +05:00
table.h Bug #40021: Renaming view fails, archived .frm for view is 2008-11-14 21:25:57 +04:00
thr_malloc.cc Bug#38296 (low memory crash with many conditions in a query) 2008-08-11 10:10:00 -06:00
time.cc Bug #29536: timestamp inconsistent in replication around 1970 2007-08-06 04:57:28 -07:00
tzfile.h Many files: 2006-12-23 20:17:15 +01:00
tztime.cc Bug #39920: MySQL cannot deal with Leap Second expression in string literal. 2008-12-01 16:18:35 +02:00
tztime.h Bug #39920: MySQL cannot deal with Leap Second expression in string literal. 2008-12-01 16:18:35 +02:00
udf_example.c Bug #30355: Incorrect ordering of UDF results 2007-11-27 17:16:52 +02:00
udf_example.def Bug #29804 UDF parameters don't contain correct string length 2007-10-17 17:54:11 -04:00
uniques.cc Fixed bug #25798. 2007-07-01 15:33:28 -07:00
unireg.cc Merge from dev tree. 2009-01-14 11:15:11 -05:00
unireg.h Bug#37428 Potential security issue with UDFs - linux shellcode execution. 2008-08-25 17:11:59 +05:00
watchdog_mysqld