Commit graph

10453 commits

Author SHA1 Message Date
unknown
124cb126fa * Bug #9676: INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big
tables
Currently in INSERT ... SELECT ... LIMIT ... the compiler uses a 
temporary table to store the results of SELECT ... LIMIT .. and then
uses that table as a source for INSERT. The problem is that in some cases
it actually skips the LIMIT clause in doing that and materializes the 
whole SELECT result set regardless of the LIMIT.
This fix is limiting the process of filling up the temp table with only 
that much rows that will be actually used by propagating the LIMIT value.


mysql-test/r/insert_select.result:
  * Bug #9676: INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big
                tables
  - a test demonstrating the code path
mysql-test/t/insert_select.test:
  * Bug #9676: INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big
                tables
  - a test demonstrating the code path
sql/sql_select.cc:
  * Bug #9676: INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big
                tables
  - pass through the real LIMIT number if the temp table is created for
    buffering results.
  - set the counter for all the cases when the temp table is not used for
    grouping
2006-06-19 13:22:42 +03:00
unknown
799c5935f0 Small fix for test suite:
- fix for IM stopping routine;
  - polishing.


mysql-test/lib/mtr_process.pl:
  Polishing: make mtr_kill_process() more verbose in debug mode.
mysql-test/mysql-test-run.pl:
  1. Fix stopping of IM running as a daemon -- after death of the main IM
  process, we should wait for the IM angel to die.
  2. Polishing -- be more verbose in debug mode.
2006-06-19 14:15:26 +04:00
unknown
0ff8d48661 Fix of test suite in scope of fixing BUG#18023: IM: instance
can be started several times; monitor interval must be > 2sec


mysql-test/r/im_daemon_life_cycle.result:
  Updated result file.
mysql-test/r/im_life_cycle.result:
  Updated result file.
mysql-test/r/im_utils.result:
  Updated result file.
mysql-test/t/im_daemon_life_cycle-im.opt:
  Set monitoring interval to 1 second in order to:
    - be consistent with 5.1;
    - speed up tests;
mysql-test/t/im_daemon_life_cycle.imtest:
  1. Use wait_for_start.sh script to minimize chance of race condition.
  2. Polishing.
mysql-test/t/im_life_cycle.imtest:
  1. Use wait_for_start.sh and wait_for_stop.sh scripts to
     minimize chance of race condition;
  2. Remove some statements, because there is no way now to
     stabilize their output.
  3. Polishing;
mysql-test/t/im_utils.imtest:
  1. Use wait_for_start.sh script to minimize chance of race condition.
  2. Polishing.
mysql-test/t/kill_n_check.sh:
  1. Make timeout configurable by command-line argument;
  2. Change algorithm of waiting for process to restart to be
     more robust.
mysql-test/t/im_life_cycle-im.opt:
  Set monitoring interval to 1 second in order to:
    - be consistent with 5.1;
    - speed up tests;
mysql-test/t/im_utils-im.opt:
  Set monitoring interval to 1 second in order to:
    - be consistent with 5.1;
    - speed up tests;
mysql-test/t/wait_for_process.sh:
  A new helper script, intended to be used instead of dummy "sleep"
  when waiting for some process to start or stop.
2006-06-19 14:13:34 +04:00
unknown
4c919abfb0 Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge


client/mysqldump.c:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
2006-06-19 12:09:24 +02:00
unknown
5375bcad69 Merge april:devel/BitKeeper/mysql-4.1
into  may.pils.ru:/home/svoj/devel/mysql/BUG18036/mysql-4.1
2006-06-19 14:13:44 +05:00
unknown
46cdd39ea6 BUG#18036 - update of table joined to self reports table as crashed
Certain updates of table joined to self results in unexpected
behavior.

The problem was that record cache was mistakenly enabled for
self-joined table updates. Normally record cache must be disabled
for such updates.

Fixed wrong condition in code that determines whether to use
record cache for self-joined table updates.

Only MyISAM tables were affected.


mysql-test/r/myisam.result:
  Test case for BUG#18036.
mysql-test/t/myisam.test:
  Test case for BUG#18036.
sql/sql_update.cc:
  Fixed wrong condition in code that determines whether to use
  record cache for self-joined table updates.
2006-06-19 14:05:14 +05:00
unknown
95939476ab Fix for bug #20496: func_time.test failure
mysql-test/r/func_time.result:
  Fix for bug #20496: func_time.test failure                                      
    - floating point calculations removed.
mysql-test/t/func_time.test:
  Fix for bug #20496: func_time.test failure                                      
    - floating point calculations removed.
2006-06-19 13:03:29 +05:00
unknown
dc3dc9a1ba Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/tmp_merge-5.0-opt-mysql


configure.in:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2006-06-19 01:16:18 +04:00
unknown
9ec3f63f7e Merge moonbone.local:/work/tmp_merge-5.0
into moonbone.local:/work/tmp_merge-5.0-opt-mysql


configure.in:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/archive.result:
  Auto merged
mysql-test/r/auto_increment.result:
  Auto merged
mysql-test/r/ndb_lock.result:
  Auto merged
mysql-test/r/rpl_log.result:
  Auto merged
mysql-test/t/archive.test:
  Auto merged
mysql-test/t/auto_increment.test:
  Auto merged
mysql-test/t/ndb_lock.test:
  Auto merged
mysql-test/t/rpl_log.test:
  Auto merged
sql/ha_archive.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2006-06-17 03:35:10 +04:00
unknown
9d3ddf3826 Manually merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/archive.result:
  Auto merged
mysql-test/r/auto_increment.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/ndb_lock.result:
  Auto merged
mysql-test/r/rpl_log.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/t/archive.test:
  Auto merged
mysql-test/t/auto_increment.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/ndb_lock.test:
  Auto merged
mysql-test/t/rpl_log.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2006-06-17 02:57:50 +04:00
unknown
60d55cc550 select.result:
After merge fix


mysql-test/r/select.result:
  After merge fix
2006-06-17 02:52:14 +04:00
unknown
d0f39b6aeb Manually merged
sql/item_timefunc.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
2006-06-17 02:11:12 +04:00
unknown
707de39a53 Merge moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
into moonbone.local:/work/tmp_merge-5.0-opt-mysql


mysql-test/r/cast.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
2006-06-17 01:57:25 +04:00
unknown
de292d6799 Manually merged
configure.in:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2006-06-17 00:58:36 +04:00
unknown
e08a2b326b Fix for bug#13479 "REPLACE activates UPDATE trigger, not the DELETE and
INSERT triggers".

In cases when REPLACE was internally executed via update and table had
on update (on delete) triggers defined we exposed the fact that such
optimization used by callng on update (not calling on delete) triggers.
Such behavior contradicts our documentation which describes REPLACE as
INSERT with optional DELETE.

This fix just disables this optimization for tables with on delete triggers.
The optimization is still applied for tables which have on update but have
no on delete triggers, we just don't invoke on update triggers in this case
and thus don't expose information about optimization to user.

Also added test coverage for values returned by ROW_COUNT() function (and
thus for values returned by mysql_affected_rows()) for various forms of
INSERT.


mysql-test/r/insert.result:
  Added test for values returned by ROW_COUNT() function (and thus for values
  returned by mysql_affected_rows()) for various forms of INSERT. We didn't
  have coverage for this before and since this fix touches related code it is
  better to add it now.
mysql-test/r/trigger.result:
  Adjusted test after fixing bug#13479 "REPLACE activates UPDATE trigger, not
  the DELETE and INSERT triggers".
mysql-test/t/insert.test:
  Added test for values returned by ROW_COUNT() function (and thus for values
  returned by mysql_affected_rows()) for various forms of INSERT. We didn't
  have coverage for this before and since this fix touches related code it is
  better to add it now.
mysql-test/t/trigger.test:
  Adjusted test after fixing bug#13479 "REPLACE activates UPDATE trigger, not
  the DELETE and INSERT triggers".
sql/sql_insert.cc:
  write_record():
    We should not expose that internally we sometimes execute REPLACE
    via UPDATE instead of documented INSERT + DELETE pair. So we should not
    use this optimization for tables with on delete triggers. OTOH it is ok
    to use it for tables which have on update but have no on delete triggers,
    we just should not invoke on update triggers in this case.
2006-06-16 20:21:25 +04:00
unknown
12ea72d1b9 Merge bk-internal:/home/bk/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0


mysql-test/mysql-test-run.pl:
  Auto merged
2006-06-16 17:30:03 +02:00
unknown
4ef7be4c32 Set default valgrind options to "-v --show-reachable=yes" and make it possible to override that with --valgrind-options
mysql-test/mysql-test-run.pl:
  Make --valgrind-all a synonym for --valgrind.
  Set "-v --show-reachable=yes" as our default valgrind options. 
  Make --valgrind-options override the default options
  Update usage.
  Turn on valgrinding also when user specified --valgrind-path or --valgrind-options without --valgrind
2006-06-16 15:56:08 +02:00
unknown
3796e37c72 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/usr/home/ram/work/mysql-5.0


sql/item_func.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2006-06-16 16:43:44 +05:00
unknown
a6686964ba Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/usr/home/ram/work/mysql-5.0
2006-06-16 15:27:04 +05:00
unknown
dd285aac1b after-merge fixes.
mysql-test/r/rpl_log.result:
  after-merge fix.
sql/ha_archive.cc:
  after-merge fix.
sql/item_func.cc:
  after-merge fix.
sql/sql_class.cc:
  after-merge fix.
sql/sql_class.h:
  after-merge fix.
2006-06-16 14:05:58 +05:00
unknown
710abe5390 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0


mysql-test/r/ctype_sjis.result:
  Auto merged
mysql-test/t/ctype_sjis.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2006-06-16 10:01:13 +02:00
unknown
64c856c939 Bug#14708: Inconsistent treatment of NULLs in LEFT JOINed FULLTEXT matching without index
Don't rely on table->null_row when no index is used - it may be a multi-table search
2006-06-16 09:49:18 +02:00
unknown
b47705abf3 Post_merges fixes. 2006-06-15 20:29:05 -07:00
unknown
79966e670a Merge rurik.mysql.com:/home/igor/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt


mysql-test/t/func_group.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/opt_sum.cc:
  Auto merged
mysql-test/r/func_group.result:
  SCCS merged
2006-06-15 18:40:18 -07:00
unknown
eb21983453 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt


sql/field.cc:
  Auto merged
sql/opt_sum.cc:
  Auto merged
2006-06-15 18:36:46 -07:00
unknown
9668198e14 BUG#19940: Add Valgrind suppression for false alarm report. 2006-06-15 22:02:26 +02:00
unknown
02b9f5b554 Merge moonbone.local:/home/evgen/bk-trees/mysql-5.0-opt
into moonbone.local:/work/18175-bug-5.0-opt
2006-06-15 22:10:47 +04:00
unknown
548b9aeff3 Fixed bug#18175: The nest_level counter wasn't decremented for union parts which
resulted in a wrong error message.

The nest_level counter indicates the depth of nesting for a subselect. It is
needed to properly resolve aggregate functions in nested subselects. Obviously 
it shouldn't be incremented for UNION parts because they have the same level of
nesting. This counter was incremented by 1 in the mysql_new_select() function
for any new select and wasn't decremented for UNION parts. This resulted in
wrongly reported error messages.

Now the nest_level counter is decremented by 1 for any union part.


mysql-test/t/union.test:
  Added test case for the bug#18175: The nest_level counter wasn't decremented for union parts which
  resulted in a wrong error message.
mysql-test/r/union.result:
  Added test case for the bug#18175: The nest_level counter wasn't decremented for union parts which
  resulted in a wrong error message.
sql/sql_yacc.yy:
  Fixed bug#18175: The nest_level counter wasn't decremented for union parts which
  resulted in a wrong error message.
  Now the nest_level counter is decremented by 1 for any union part.
2006-06-15 22:09:58 +04:00
unknown
2fc416fe22 Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge
2006-06-15 15:54:50 +02:00
unknown
629830d962 Merge moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
into moonbone.local:/work/16377-4.1-after
2006-06-15 16:41:26 +04:00
unknown
e4bfa961ae item_cmpfunc.h, cast.result:
Post fix for bug#16377


mysql-test/r/cast.result:
  Post fix for bug#16377
sql/item_cmpfunc.h:
  Post fix for bug#16377
2006-06-15 16:39:18 +04:00
unknown
4a9985762e Merge mysql.com:/usr/home/ram/work/mysql-4.1
into  mysql.com:/usr/home/ram/work/mysql-5.0


mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/archive.result:
  Auto merged
mysql-test/r/auto_increment.result:
  Auto merged
mysql-test/r/ndb_lock.result:
  Auto merged
mysql-test/r/rpl_log.result:
  Auto merged
mysql-test/t/archive.test:
  Auto merged
mysql-test/t/auto_increment.test:
  Auto merged
mysql-test/t/ndb_lock.test:
  Auto merged
mysql-test/t/rpl_log.test:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
configure.in:
  ul
sql/ha_archive.cc:
  ul
sql/item_func.cc:
  ul
2006-06-15 17:37:47 +05:00
unknown
689205ae94 Fix for bug#19667 group by a decimal expression yields wrong result
mysql-test/r/type_newdecimal.result:
  Fix for bug#19667 group by a decimal expression yields wrong result
   test case
mysql-test/t/type_newdecimal.test:
  Fix for bug#19667 group by a decimal expression yields wrong result
   test case
2006-06-15 16:24:02 +05:00
unknown
81bc8d3bc7 Merge moonbone.local:/home/evgen/bk-trees/mysql-5.0-opt
into moonbone.local:/work/19789-bug-5.0-opt-mysql
2006-06-15 15:01:37 +04:00
unknown
99c320d7cf Merge moonbone.local:/work/15351-bug-4.1-mysql
into moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt


sql/item_strfunc.cc:
  Auto merged
2006-06-15 14:57:53 +04:00
unknown
7eec6c3f04 BUG#17201: Removed version number from test case output
mysql-test/r/mysqldump.result:
  Remove comments in mysqldump output
mysql-test/t/mysqldump.test:
  Remove comments in mysqldump output
2006-06-15 11:55:53 +02:00
unknown
ef02d496a0 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b15558
2006-06-15 11:15:56 +05:00
unknown
b2f308160b Many files:
After merge fix


mysql-test/r/func_time.result:
  After merge fix
mysql-test/r/func_concat.result:
  After merge fix
mysql-test/r/cast.result:
  After merge fix
sql/item_cmpfunc.h:
  After merge fix
sql/item_cmpfunc.cc:
  After merge fix
sql/field.cc:
  After merge fix
2006-06-15 01:48:41 +04:00
unknown
9936533be9 Manually merged
mysql-test/r/cast.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/opt_sum.cc:
  Auto merged
sql/structs.h:
  Auto merged
2006-06-14 23:54:08 +04:00
unknown
013d0ccfaa Merge poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-main


sql/ha_ndbcluster.cc:
  Auto merged
2006-06-14 20:27:32 +02:00
unknown
39246e2fa7 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.0


sql/ha_ndbcluster.cc:
  manual merge
2006-06-14 20:25:51 +02:00
unknown
06828ae513 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
into  poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main


sql/ha_ndbcluster.cc:
  Auto merged
2006-06-14 20:18:01 +02:00
unknown
ca1fd91f16 Bug #19493 NDB does not ignore duplicate keys when using LOAD DATA LOCAL
- make sure to disable bulk insert when check for duplicate key is needed


mysql-test/r/ndb_loaddatalocal.result:
  New BitKeeper file ``mysql-test/r/ndb_loaddatalocal.result''
mysql-test/t/ndb_loaddatalocal.test:
  New BitKeeper file ``mysql-test/t/ndb_loaddatalocal.test''
2006-06-14 20:16:32 +02:00
unknown
b395f9c29e Merge mysql.com:/home/kgeorge/mysql/5.0/teamclean
into  mysql.com:/home/kgeorge/mysql/5.0/B18895
2006-06-14 17:37:26 +03:00
unknown
ac9a5303d4 Merge mysql.com:/home/kgeorge/mysql/5.0/teamclean
into  mysql.com:/home/kgeorge/mysql/5.0/B18895
2006-06-14 17:35:14 +03:00
unknown
dd24721737 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into moonbone.local:/home/evgen/bk-trees/mysql-5.0-opt
2006-06-14 17:18:42 +04:00
unknown
89ce81ceed Bug #18895: BIT values cause joins to fail
The Field::eq() considered instances of Field_bit that differ only in 
bit_ptr/bit_ofs equal. This caused equality conditions optimization 
(build_equal_items_for_cond()) to make bad field substitutions that result
in wrong predicates. 
Field_bit requires an overloaded eq() function that checks the bit_ptr/bit_ofs
in addition to Field::eq().


mysql-test/r/select.result:
  Bug #18895: BIT values cause joins to fail
  
  - test case
mysql-test/t/select.test:
  Bug #18895: BIT values cause joins to fail
  
  - test case
sql/field.h:
  Bug #18895: BIT values cause joins to fail
  
  - eq() method overloaded for Field_bit
2006-06-14 15:57:23 +03:00
unknown
5c5d721f28 Merge moonbone.local:/home/evgen/bk-trees/mysql-5.0-opt
into moonbone.local:/work/15962-bug-5.0-opt-mysql
2006-06-14 15:27:27 +04:00
unknown
665d17c685 Merge mysql.com:/home/kgeorge/mysql/5.0/teamclean
into  mysql.com:/home/kgeorge/mysql/5.0/B20195
2006-06-14 10:41:35 +03:00
unknown
5eead315e0 Post-review corrections of the fix for bug #18206.
mysql-test/r/func_group.result:
  Added another test case for bug #18206.
mysql-test/t/func_group.test:
  Added another test case for bug #18206.
2006-06-13 22:38:00 -07:00
unknown
61684e2e75 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-4.1-opt


sql/field.cc:
  Auto merged
2006-06-13 22:33:38 -07:00
unknown
69e344e0b2 Merge rurik.mysql.com:/home/igor/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt


mysql-test/t/ctype_utf8.test:
  Auto merged
sql/opt_sum.cc:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Manual merge
sql/field.cc:
  Manual merge
2006-06-13 20:04:48 -07:00
unknown
36b49259b1 Fixed bug #14896.
This bug in Field_string::cmp resulted in a wrong comparison 
with keys in partial indexes over multi-byte character fields.
Given field a is declared as 
  a varchar(16) collate utf8_unicode_ci
INDEX(a(4)) gives us an example of such an index.

Wrong key comparisons could lead to wrong result sets if 
the selected query execution plan used a range scan by 
a partial index over a utf8 character field.
This also caused wrong results in many other cases.


mysql-test/r/ctype_utf8.result:
  Added test cases for bug #14896.
mysql-test/t/ctype_utf8.test:
  Added test cases for bug #14896.
2006-06-13 19:57:50 -07:00
unknown
de5de7c319 ndb - bug#20406 multi-platform testing - not FIX 2006-06-14 00:38:34 +02:00
unknown
9237d65d33 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
2006-06-13 22:53:30 +04:00
unknown
01c9fd31d7 Bug #20195: INSERT DELAYED with auto_increment is assigned wrong values
The INSERT DELAYED should not maintain its own private auto-increment
counter, because this is assuming that other threads cannot insert
into the table while the INSERT DELAYED thread is inserting, which is
a wrong assumption.

So the start of processing of a batch of INSERT rows in the 
INSERT DELAYED thread must be treated as a start of a new statement
and cached next_insert_id must be cleared.


mysql-test/r/delayed.result:
  test suite for the bug
mysql-test/t/delayed.test:
  test suite for the bug
sql/sql_insert.cc:
  Reset auto-increment cacheing before processing
  the next batch of inserts in the handler thread
2006-06-13 18:18:32 +03:00
unknown
6297d1ab38 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/work/16377-bug-4.1-opt-mysql
2006-06-13 19:10:27 +04:00
unknown
47311e8e87 Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.

All date/time functions has the STRING result type thus their results are
compared as strings. The string date representation allows a user to skip 
some of leading zeros. This can lead to wrong comparison result if a date/time 
function result is compared to such a string constant.

The idea behind this bug fix is to compare results of date/time functions
and data/time constants as ints, because that date/time representation is 
more exact. To achieve this the agg_cmp_type() is changed to take in the
account that a date/time field or an date/time item should be compared 
as ints.

This bug fix is partially back ported from 5.0.

The agg_cmp_type() function now accepts THD as one of parameters. 
In addition, it now checks if a date/time field/function is present in the
list. If so, it tries to coerce all constants to INT to make date/time
comparison return correct result. The field for the constant coercion is
taken from the Item_field or constructed from the Item_func. In latter case
the constructed field will be freed after conversion of all constant items.
Otherwise the result is same as before - aggregated with help of the
item_cmp_type() function.

From the Item_func_between::fix_length_and_dec() function removed the part
which was converting date/time constants to int if possible. Now this is 
done by the agg_cmp_type() function.

The new function result_as_longlong() is added to the Item class. 
It indicates that the item is a date/time item and result of it can be
compared as int. Such items are date/time fields/functions.

Correct val_int() methods are implemented for classes Item_date_typecast, 
Item_func_makedate, Item_time_typecast, Item_datetime_typecast. All these
classes are derived from Item_str_func and Item_str_func::val_int() converts
its string value to int without regard to the date/time type of these items.

Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func()
functions are changed to substitute result type of an item with the INT_RESULT
if the item is a date/time item and another item is a constant. This is done
to get a correct result of comparisons like date_time_function() = string_constant.


mysql-test/r/cast.result:
  Fixed wrong test case result after bug fix#16377.
sql/item_timefunc.h:
  Fixed bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.
  The result_as_longlong() function is set to return TRUE for these classes:
  Item_date, Item_date_func, Item_func_curtime, Item_func_sec_to_time,
  Item_date_typecast, Item_time_typecast, Item_datetime_typecast,
  Item_func_makedate.
sql/item_timefunc.cc:
  Fixed bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.Correct val_int() methods are implemented for classes Item_date_typecast, 
  Item_func_makedate, Item_time_typecast, Item_datetime_typecast.
sql/item_cmpfunc.h:
  Fixed bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.
  Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func()
  functions are changed to substitute result type of an item with the INT_RESULT
  if the item is a date/time item and another item is a constant.
sql/field.cc:
  Fixed bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.
  Field::set_warning(), Field::set_datetime_warning() now use current_thd to get thd if table isn't set.
sql/item_cmpfunc.cc:
  Fixed bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.
  The agg_cmp_type() function now accepts THD as one of parameters. 
  In addition, it now checks if a date/time field/function is present in the
  list. If so, it tries to coerce all constants to INT to make date/time
  comparison return correct result. The field for the constant coercion is
  taken from the Item_field or constructed from the Item_func. In latter case
  the constructed field will be freed after conversion of all constant items.
  Otherwise the result is same as before - aggregated with help of the
  item_cmp_type() function.
sql/item.h:
  The new function result_as_longlong() is added to the Item class. 
  It indicates that the item is a date/time item and result of it can be
  compared as int. Such items are date/time fields/functions.
mysql-test/t/func_time.test:
  Added test case fot bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.
mysql-test/r/func_time.result:
  Added test case fot bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.
2006-06-13 19:09:24 +04:00
unknown
31ed3fd396 Merge mysql.com:/home/kgeorge/mysql/5.0/clean
into  mysql.com:/home/kgeorge/mysql/5.0/B20363
2006-06-12 18:28:04 +03:00
unknown
e7daa49761 Bug #20363: Create view on just created view is now denied
There was a wrong determination of the DB name (witch is 
not always the one in TABLE_LIST because derived tables
may be calculated using temp tables that have their db name
set to "").
The fix determines the database name according to the type 
of table reference, and calls the function check_access() 
with the correct db name so the correct set of grants is found.


mysql-test/r/view_grant.result:
  testsuite for the bug
mysql-test/t/view_grant.test:
  testsuite for the bug
sql/sql_parse.cc:
  correct determination of the db name.
2006-06-12 18:15:08 +03:00
unknown
3f19b05bb0 Added order by 2006-06-12 15:36:12 +02:00
unknown
7e3fe0fc91 Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/marty/MySQL/mysql-5.0


ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
2006-06-12 15:36:10 +02:00
unknown
b10b25fbb5 Added order by 2006-06-12 15:35:47 +02:00
unknown
7b207a8301 Merge mskold@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/marty/MySQL/mysql-4.1
2006-06-12 15:35:46 +02:00
unknown
8d33265571 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
2006-06-12 15:56:21 +04:00
unknown
ce8b60b4f9 Merge moonbone.local:/work/16716-bug-4.1-mysql
into moonbone.local:/work/16716-bug-4.1-opt-mysql
2006-06-12 15:50:59 +04:00
unknown
55d554bd1d Fix for Bug #18184 SELECT ... FOR UPDATE does not work..: Skipped lock check for full table scan due to bug #20390 SELECT FOR UPDATE does not release locks of untouched rows in full table scans 2006-06-12 10:40:56 +02:00
unknown
8ea1058455 Merge mysql.com:/home/marty/MySQL/mysql-4.1
into  mysql.com:/home/marty/MySQL/mysql-5.0


sql/ha_ndbcluster.cc:
  Merge (using local)
2006-06-12 09:42:20 +02:00
unknown
a3f3696697 Added lock test on index scan 2006-06-12 09:28:27 +02:00
unknown
86334edf2e Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt
2006-06-11 13:45:18 -07:00
unknown
2dd1dc6246 Merge mysql.com:/home/mydev/mysql-5.0
into  mysql.com:/home/mydev/mysql-5.0-amerge


mysql-test/r/lock_multi.result:
  Merging 5.0-engines to 5.0 master.
mysql-test/t/lock_multi.test:
  Merging 5.0-engines to 5.0 master.
2006-06-10 12:24:44 +02:00
unknown
a74154f4de Post-merge fixes 2006-06-09 19:29:39 -07:00
unknown
ddd55d4349 Merge rurik.mysql.com:/home/igor/tmp_merge
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0


VC++Files/client/mysql.dsp:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
client/mysqldump.c:
  Manual merge
mysql-test/r/func_time.result:
  Manual merge
2006-06-09 17:56:08 -07:00
unknown
ac7d73b004 Merge bk-internal:/home/bk/mysql-4.1
into  mysql.com:/data0/mysqldev/my/mysql-4.1
2006-06-09 22:42:34 +02:00
unknown
8e418820e9 Merge bk-internal:/home/bk/mysql-5.0
into  mysql.com:/data0/mysqldev/my/mysql-5.0
2006-06-09 22:34:21 +02:00
unknown
a6042ffbe9 Merge trift2.mysql.com:/M41/bug20303-4.1
into trift2.mysql.com:/M41/mysql-4.1


mysql-test/mysql-test-run.pl:
  Auto merged
2006-06-09 14:37:24 +02:00
unknown
9e9a14bac8 Merge trift2.mysql.com:/M50/bug20303-5.0
into trift2.mysql.com:/M50/mysql-5.0


mysql-test/mysql-test-run.pl:
  Auto merged
2006-06-09 14:13:01 +02:00
unknown
b2d3ac1b6b Merge mysql.com:/home/marty/MySQL/mysql-4.1
into  mysql.com:/home/marty/MySQL/mysql-5.0


ndb/src/ndbapi/ndberror.c:
  Auto merged
BitKeeper/deleted/.del-NdbResultSet.cpp~84d192cf3f42600d:
  Merge (keeping local)
BitKeeper/deleted/.del-NdbResultSet.hpp~e0042f4c18088ff6:
  Merge (keeping local)
ndb/include/ndbapi/NdbIndexScanOperation.hpp:
  Merge
ndb/include/ndbapi/NdbScanOperation.hpp:
  Merge
ndb/src/ndbapi/NdbScanOperation.cpp:
  Merge
sql/ha_ndbcluster.cc:
  Merge (using local, will fix manually)
sql/ha_ndbcluster.h:
  Merge
2006-06-09 12:07:04 +02:00
unknown
4f0935c4cb Merge mysql.com:/M41/bug20303-4.1 into mysql.com:/M50/bug20303-5.0
mysql-test/mysql-test-run.pl:
  Auto merged
2006-06-08 19:57:26 +02:00
unknown
f32d05f516 mysql-test/mysql-test-run.pl : Output the usage error if one is given. (Found when fixing bug#20303)
mysql-test/mysql-test-run.pl:
  Found when fixing bug#20303: The "usage()" function ignored the message it was given,
  so we got no real indication about the problem. Print it if one is given.
2006-06-08 19:55:22 +02:00
unknown
4f192a1e9e Merge mysql.com:/M41/bug20303-4.1 into mysql.com:/M50/bug20303-5.0
mysql-test/mysql-test-run.pl:
  Auto merged
2006-06-08 19:32:25 +02:00
unknown
20e54ae6c5 Fix for Bug #18184 SELECT ... FOR UPDATE does not work..: implemented ha_ndblcuster::unlock_row() and explicitly lock all rows that are not being unlocked 2006-06-08 16:12:38 +02:00
unknown
d0d69b7676 mysql-test/mysql-test-run.pl : A fix for bug#20303 "mysql-test-run.pl: Does not recognize -- argument"
mysql-test/mysql-test-run.pl:
  A fix for bug#20303 "mysql-test-run.pl: Does not recognize -- argument":
  Due to the use of 'pass_through' in option processing this lone '--' will remain
  as an argument, it must be ignored explicitly.
2006-06-08 14:52:33 +02:00
unknown
6474219467 Merge mysql.com:/home/kgeorge/mysql/5.0/teamclean
into  mysql.com:/home/kgeorge/mysql/5.0/B15355
2006-06-08 14:26:02 +03:00
unknown
a7566db788 Bug #15355: Common natural join column not resolved in prepared statement nested
query
Problem:
There was a wrong context assigned to the columns that were added in insert_fields()
when expanding a '*'. When this is done in a prepared statement it causes 
fix_fields() to fail to find the table that these columns reference.
Actually the right context is set in setup_natural_join_row_types() called at the 
end of setup_tables(). However when executed in a context of a prepared statement
setup_tables() resets the context, but setup_natural_join_row_types() was not
setting it to the correct value assuming it has already done so.

Solution:
The top-most, left-most NATURAL/USING join must be set as a 
first_name_resolution_table in context even when operating on prepared statements.


mysql-test/r/join.result:
  testsuite for the bug
mysql-test/t/join.test:
  testsuite for the bug
sql/sql_base.cc:
  The context must be set even when executed as prepared statement.
2006-06-08 13:34:03 +03:00
unknown
683ebcd101 Fixed bug#19789: REPLACE was allowed for a VIEW with CHECK OPTION enabled.
The st_lex::which_check_option_applicable() function controls for which 
statements WITH CHECK OPTION clause should be taken into account. REPLACE and
REPLACE_SELECT wasn't in the list which results in allowing REPLACE to insert
wrong rows in a such view.

The st_lex::which_check_option_applicable() now includes REPLACE and 
REPLACE_SELECT in the list of statements for which WITH CHECK OPTION clause is
applicable.


mysql-test/t/replace.test:
  Added test case for bug#19789: REPLACE was allowed for a VIEW with CHECK OPTION enabled.
mysql-test/r/replace.result:
  Added test case for bug#19789: REPLACE was allowed for a VIEW with CHECK OPTION enabled.
sql/sql_lex.h:
  Fixed bug#19789: REPLACE was allowed for a VIEW with CHECK OPTION enabled.
  The st_lex::which_check_option_applicable() now includes REPLACE and 
  REPLACE_SELECT in the list of statements for which WITH CHECK OPTION clause is
  applicable.
2006-06-07 16:17:56 +04:00
unknown
3cbf2eafbf Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b6880
2006-06-07 14:40:33 +05:00
unknown
febe7eb64a Fix for bug #6880: LAST_INSERT_ID() within a statement
mysql-test/r/auto_increment.result:
  Fix for bug #6880: LAST_INSERT_ID() within a statement
    - test result
mysql-test/r/rpl_log.result:
  Fix for bug #6880: LAST_INSERT_ID() within a statement
    - test result
mysql-test/t/auto_increment.test:
  Fix for bug #6880: LAST_INSERT_ID() within a statement
    - test case
mysql-test/t/rpl_log.test:
  Fix for bug #6880: LAST_INSERT_ID() within a statement
    - test case
sql/item_func.cc:
  Fix for bug #6880: LAST_INSERT_ID() within a statement
    - return the first thd->last_insert_id set (within a query)
2006-06-07 14:01:10 +05:00
unknown
6e80e9a4f9 Fixed bug#15962: CONCAT() in UNION may lead to a data trucation.
To calculate its max_length the CONCAT() function is simply sums max_lengths
of its arguments but when the collation of an argument differs from the 
collation of the CONCAT() max_length will be wrong. This may lead to a data
truncation when a tmp table is used, in UNIONS for example.

The Item_func_concat::fix_length_and_dec() function now recalculates the 
max_length of an argument when the mbmaxlen of the argument differs from the
mbmaxlen of the CONCAT().


mysql-test/t/func_concat.test:
  Added test case for bug#15962:CONCAT() in UNION may lead to a data trucation.
mysql-test/r/func_concat.result:
  Added test case for bug#15962:CONCAT() in UNION may lead to a data trucation.
sql/item_strfunc.cc:
  Fixed bug#15962: CONCAT() in UNION may lead to a data trucation.
  The Item_func_concat::fix_length_and_dec() function now recalculates the 
  max_length of an argument when the mbmaxlen of the argument differs from the
  mbmaxlen of the CONCAT().
2006-06-07 01:10:23 +04:00
unknown
958e838786 Merge bk-internal:/home/bk/mysql-5.0
into  mysql.com:/data0/mysqldev/my/mysql-5.0
2006-06-06 22:12:14 +02:00
unknown
63339c8941 Merge aivanov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/home/alexi/innodb/mysql-5.0-ss609
2006-06-06 23:56:48 +04:00
unknown
9e3f90e541 Applied innodb-5.0-ss609 snapshot.
Fixed BUG#19727 "InnoDB crashed server and crashed tables
 are not recoverable".


innobase/row/row0mysql.c:
  Applied innodb-5.0-ss609 snapshot.
   Move trx_commit_for_mysql(trx) calls before calls to
   row_mysql_unlock_data_dictionary(trx).
innobase/row/row0sel.c:
  Applied innodb-5.0-ss609 snapshot.
   row_sel_try_search_shortcut(): Do not return SEL_FOUND when
   the record was not found. This bug was introduced in
   InnoDB 5.0.3, but luckily it should nerver manifest itself,
   given that existing InnoDB SQL code never makes use of
   consistent reads.
mysql-test/t/innodb.test:
  Applied innodb-5.0-ss609 snapshot.
   Add the big fat warning notice also to the bottom of
   innodb.test so that it will require more talent to
   ignore the change of policy.
2006-06-06 23:37:42 +04:00
unknown
57e7bc5513 Bug#18035 Information Schema: Output is not Sorted
added 'order by' to avoid result order difference
2006-06-06 12:57:50 +05:00
unknown
581d4d23a1 Bug#19599 duplication of information_schema column value in a CONCAT expr with user var
mark result string using String::mark_as_const()
which prevents CONCAT from reusing it as a buffer
for concatenation result.


mysql-test/r/information_schema.result:
  Bug#19599 duplication of information_schema column value in a CONCAT expr with user var
  test case
mysql-test/t/information_schema.test:
  Bug#19599 duplication of information_schema column value in a CONCAT expr with user var
  test case
2006-06-06 12:51:04 +05:00
unknown
6c431a5ecd Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
fix: return db name for I_S.TABLES(and others) in original letter case.
if mysql starts with lower_case_table_names=1 | 2 then original db name is converted
to lower case(for I_S tables). It happens when we perform add_table_to_list. 
to avoid this we make a copy of original db name and use the copy hereafter.


mysql-test/r/lowercase_table2.result:
  Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
  test case
mysql-test/t/lowercase_table2.test:
  Bug#17661 information_schema.SCHEMATA returns uppercase with lower_case_table_names = 1
  test case
2006-06-06 11:25:31 +05:00
unknown
f1b1c0eb3f Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b16546


sql/item_timefunc.cc:
  Auto merged
mysql-test/r/func_time.result:
  merging
mysql-test/t/func_time.test:
  merging
2006-06-06 09:10:28 +05:00
unknown
63a40dca35 Merge anna@bk-internal.mysql.com:/home/bk/mysql-5.0
into  arthur.local:/home/my/mysql-5.0-clean
2006-06-05 11:59:44 +03:00
unknown
8b6806800a BUG#19479: mysqldump creates invalid dump
Moved the test case to separate non-windows specific file.


mysql-test/r/create.result:
  Moved non-windows specific test case to create_not_windows.test.
mysql-test/t/create.test:
  Moved non-windows specific test case to create_not_windows.test.
mysql-test/r/create_not_windows.result:
  #19479: mysqldump creates invalid dump
  Moved the non-windows specific test case from create.test.
mysql-test/t/create_not_windows.test:
  #19479: mysqldump creates invalid dump
  Moved the non-windows specific test case from create.test.
2006-06-04 21:27:41 +03:00
unknown
5fd2a35032 Merge rurik.mysql.com:/home/igor/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt


sql/opt_sum.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
mysql-test/r/func_group.result:
  SCCS merged
mysql-test/t/func_group.test:
  SCCS merged
2006-06-02 17:06:10 -07:00
unknown
ccad0572f5 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-4.1-opt
2006-06-02 14:16:22 -07:00