mariadb/sql
timour@mysql.com 294498e203 Fix for BUG#11185.
The source of the problem is in Field_longlong::cmp. If 'this' is
an unsigned number, the method casts both the current value, and
the constant that we compare with to an unsigned number. As a
result if the constant we compare with is a negative number, it
wraps to some unsigned number, and the comparison is incorrect.

When the optimizer chooses the "range" access method, this problem
causes handler::read_range_next to reject the current key when the
upper bound key is a negative number because handler::compare_key
incorrectly considers the positive and negative keys to be equal.

The current patch does not correct the source of the problem in
Field_longlong::cmp because it is not easy to propagate sign
information about the constant at query execution time. Instead
the patch changes the range optimizer so that it never compares
unsiged fields with negative constants. As an added benefit,
queries that do such comparisons will execute faster because
the range optimizer replaces conditions like:
(a) (unsigned_int [< | <=] negative_constant) == FALSE
(b) (unsigned_int [> | >=] negative_constant) == TRUE
with the corresponding constants.
In some cases this may even result in constant time execution.
2005-06-23 10:56:44 +03:00
..
examples a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
share Fix wrong format specifier in error messages. 2005-05-14 02:28:10 +04:00
.cvsignore
add_errmsg
client_settings.h
custom_conf.h
derror.cc
des_key_file.cc
discover.cc
field.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
field.h group_by.result: 2005-06-20 10:49:04 -07:00
field_conv.cc Merge changed tests 2005-01-18 12:25:56 -08:00
filesort.cc A fix (bug #8799: Killed filesorts can fail inited==RND assertion in ha_rnd_end). 2005-03-15 15:32:11 +04:00
frm_crypt.cc
gen_lex_hash.cc
gstream.cc
gstream.h
ha_berkeley.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
ha_berkeley.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
ha_blackhole.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
ha_blackhole.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
ha_heap.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
ha_heap.h Increase limit of partial key length in MEMORY storage engine 2005-05-24 12:21:15 -07:00
ha_innodb.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
ha_innodb.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
ha_isam.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
ha_isam.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
ha_isammrg.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
ha_isammrg.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
ha_myisam.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
ha_myisam.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
ha_myisammrg.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
ha_myisammrg.h Bug#10400 - Improperly-defined MERGE table crashes with INSERT ... ON DUPLICATE KEY UPDATE 2005-05-18 19:40:39 +02:00
ha_ndbcluster.cc ha_ndbcluster.cc: 2005-06-20 17:17:44 +02:00
ha_ndbcluster.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
handler.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
handler.h Bug#10400 - Improperly-defined MERGE table crashes with INSERT ... ON DUPLICATE KEY UPDATE 2005-05-18 19:40:39 +02: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 Fixes during review 2005-05-13 14:04:32 +03:00
init.cc
item.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
item.h sql_select.cc, item_buff.cc, item.h: 2005-06-07 03:05:57 -07:00
item_buff.cc group_by.result, group_by.test: 2005-06-21 04:24:21 -07:00
item_cmpfunc.cc func_if.result, func_if.test: 2005-06-13 11:24:26 -07:00
item_cmpfunc.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
item_create.cc Merging fix for bug #9796 "Query Cache caches queries with CURRENT_USER() 2005-04-11 10:44:48 +04:00
item_create.h Making 4.1 tree compile with -ansi -pedantic 2004-12-16 16:16:28 +03:00
item_func.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
item_func.h Merge bk-internal.mysql.com:/home/bk/mysql-4.1 2005-05-09 12:16:59 +02:00
item_geofunc.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
item_geofunc.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
item_row.cc Better bugfix for "HAVING when refering to RAND()" (Bug #8216) 2005-02-08 14:41:09 +02:00
item_row.h
item_strfunc.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
item_strfunc.h Remove testcode 2005-05-10 10:45:16 +02:00
item_subselect.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
item_subselect.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
item_sum.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
item_sum.h Merge bk-internal.mysql.com:/home/bk/mysql-4.1 2005-05-09 12:16:59 +02:00
item_timefunc.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
item_timefunc.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
item_uniq.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
item_uniq.h Add ifdefs to control when "#pragma implementation" should be used 2005-05-26 12:09:14 +02:00
key.cc Merge 2005-03-17 10:59:25 +04:00
lex.h WL#1596 "make mysqldump --master-data --single-transaction able to do online dump of InnoDB AND report reliable 2004-11-10 17:56:45 +01:00
lex_symbol.h
lock.cc merged 2005-06-03 18:29:36 +02:00
log.cc Bug#8412: Setting error code to 0 on statements that cannot fail. 2005-02-23 20:59:00 +01:00
log_event.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
log_event.h Add ifdefs to control when "#pragma implementation" should be used 2005-05-26 12:09:14 +02:00
Makefile.am Makefile.am: 2005-06-20 18:03:30 +02:00
matherr.c
mf_iocache.cc
my_lock.c
mysql_priv.h Fix Bug#9334 "PS API queries in log file" and 2005-06-17 00:11:48 +04:00
mysqld.cc Fix Bug#9334 "PS API queries in log file" and 2005-06-17 00:11:48 +04:00
mysqld_suffix.h
net_serv.cc Bug #9721 net_write_timeout not used on Windows 2005-05-05 17:17:57 +02:00
nt_servc.cc
nt_servc.h
opt_range.cc Fix for BUG#11185. 2005-06-23 10:56:44 +03:00
opt_range.h Move USE_PRAGMA_IMPLEMENTATION to proper place 2005-06-03 23:46:03 +03:00
opt_sum.cc logging_ok: 2005-03-04 20:24:13 -08:00
password.c sql/password.c: check for buffer overflow in check_scramble_323 (BUG#7187) 2004-12-11 10:17:25 +01:00
procedure.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
procedure.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
protocol.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
protocol.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
protocol_cursor.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
records.cc
repl_failsafe.cc Mainly cleanups for gcc 4.0. Some small pieces from looking at -Wall. Removed a number of dumb things in ha_tina. 2005-06-01 17:34:10 -07:00
repl_failsafe.h
set_var.cc Fix for bug#10732: Set SQL_MODE to NULL gives garbled error message 2005-06-09 14:39:29 +05:00
set_var.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
slave.cc Mainly cleanups for gcc 4.0. Some small pieces from looking at -Wall. Removed a number of dumb things in ha_tina. 2005-06-01 17:34:10 -07:00
slave.h "After Monty's review" changes to the fix for BUG#8325 "Deadlock in replication thread stops replication": 2005-03-23 19:19:36 +01:00
spatial.cc hf's fix for bug #10626 ( gis.test fails) 2005-05-19 22:53:35 +05:00
spatial.h Fix compiler warnings (detected by Intel's C++ compiler) 2004-10-22 18:44:51 +03:00
sql_acl.cc Merge rburnett@bk-internal.mysql.com:/home/bk/mysql-4.1 2005-06-07 15:45:02 -05:00
sql_acl.h fixes/cleanups according to Coverity report 2005-01-24 15:48:25 +01:00
sql_analyse.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
sql_analyse.h Add ifdefs to control when "#pragma implementation" should be used 2005-05-26 12:09:14 +02:00
sql_base.cc merged 2005-06-03 18:29:36 +02:00
sql_bitmap.h terminal.c, sql_bitmap.h, my_sys.h, configure.in, config.h: 2005-05-05 09:15:14 +02:00
sql_cache.cc Fix crash in embedded server due to incorrect storage of results 2005-03-31 19:17:45 -08:00
sql_cache.h Merge with 4.0 2004-10-27 19:52:41 +03:00
sql_class.cc Many files: 2005-06-07 06:34:13 -07:00
sql_class.h A fix for Bug#9141 "4.1 does not log into slow log 2005-06-16 23:05:38 +04:00
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_db.cc BUG# 9148: Denial of service 2005-05-20 16:04:10 -05:00
sql_delete.cc merged 2005-04-14 21:31:22 +02:00
sql_derived.cc fixed union types merging and table related metadata (BUG#8824) 2005-03-23 08:36:48 +02:00
sql_do.cc Fix for bug #6765 "Implicit access to time zone description 2004-12-09 13:31:46 +03:00
sql_error.cc Fix show warnings limit 0 and show warnings limit 0, 0. 2005-06-04 14:58:32 +04:00
sql_handler.cc bug#5373: handler READ NEXT w/o HANDLER READ [FIRST] 2005-06-07 22:43:25 +02:00
sql_help.cc * Added comments and one assert 2004-12-14 03:36:19 +03:00
sql_insert.cc Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1 2005-06-21 22:25:49 +04:00
sql_lex.cc Cleanup during code review 2005-05-25 12:56:47 +03:00
sql_lex.h fixed union types merging and table related metadata (BUG#8824) 2005-03-23 08:36:48 +02:00
sql_list.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
sql_list.h merged 2005-05-18 22:14:08 +02:00
sql_load.cc Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag 2004-12-31 12:04:35 +02:00
sql_manager.cc
sql_manager.h
sql_map.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02: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 a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
sql_parse.cc Fix Bug#9334 "PS API queries in log file" and 2005-06-17 00:11:48 +04:00
sql_prepare.cc Fix Bug#9334 "PS API queries in log file" and 2005-06-17 00:11:48 +04:00
sql_rename.cc Bug#6391 (binlog-do-db rules ignored) 2004-12-03 12:13:51 +01:00
sql_repl.cc merged 2005-06-03 18:29:36 +02:00
sql_repl.h Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag 2004-12-31 12:04:35 +02:00
sql_select.cc Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1 2005-06-20 06:13:30 -07:00
sql_select.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
sql_show.cc Fix for BUG#9439: 2005-04-16 23:35:39 +04:00
sql_sort.h
sql_state.c
sql_string.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
sql_string.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
sql_table.cc Bug#11028 Crash on create table like 2005-06-09 16:06:15 +01:00
sql_test.cc
sql_udf.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
sql_udf.h Merge bk-internal.mysql.com:/home/bk/mysql-4.1 2005-05-09 12:16:59 +02:00
sql_union.cc Merge 2005-03-30 10:27:36 +03:00
sql_update.cc Merge from 4.0 2005-02-18 14:19:08 +01:00
sql_yacc.yy Move USE_PRAGMA_IMPLEMENTATION to proper place 2005-06-03 23:46:03 +03:00
stacktrace.c Step 2 of the switch to support configuration with NPTL: 2005-04-20 20:38:57 +02:00
stacktrace.h Step 2 of the switch to support configuration with NPTL: 2005-04-20 20:38:57 +02:00
strfunc.cc - Housekeeping: removed a few unreferenced variables, noticed while doing 2005-01-11 15:38:03 +01:00
structs.h "After Monty's review" changes to the fix for BUG#8325 "Deadlock in replication thread stops replication": 2005-03-23 19:19:36 +01:00
table.cc Bug#10400 - Improperly-defined MERGE table crashes with INSERT ... ON DUPLICATE KEY UPDATE 2005-05-18 19:40:39 +02:00
table.h Bug#7806 - insert on duplicate key and auto-update of timestamp 2005-04-22 12:30:09 +02:00
thr_malloc.cc Simpler arena swapping code 2004-11-08 01:13:54 +02:00
time.cc Fix for bug #7297 "Two digit year should be interpreted correctly 2004-12-16 16:31:50 +03:00
tzfile.h
tztime.cc a compiler must see '#pragma implementation' *before* 2005-06-05 19:38:52 +02:00
tztime.h BUG#10241 cygwin port: invalid pragma interface directives 2005-05-04 15:05:56 +02:00
udf_example.cc Ensure that we free memory used with --order-by-primary (in mysqldump) 2004-12-09 12:47:20 +02:00
uniques.cc
unireg.cc merged 2005-05-18 22:14:08 +02:00
unireg.h Fixed bug in HAVING when refering to RAND() through alias 2005-02-07 18:13:57 +02:00
watchdog_mysqld