Commit graph

35313 commits

Author SHA1 Message Date
unknown
542f18a31a Bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were
touched but not actually changed.

The LAST_INSERT_ID() is reset to 0 if no rows were inserted or changed.
This is the case when an INSERT ... ON DUPLICATE KEY UPDATE updates a row
with the same values as the row contains.

Now the LAST_INSERT_ID() values is reset to 0 only if there were no rows
successfully inserted or touched.
The new 'touched' field is added to the COPY_INFO structure. It holds the
number of rows that were touched no matter whether they were actually
changed or not.


sql/sql_class.h:
  Bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were
  touched but not actually changed.
  
  The new 'touched' field is added to the COPY_INFO structure. It holds the
  number of rows that were touched no matter whether they were actually
  changed or not.
mysql-test/r/insert_update.result:
  Added a test case for the bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were
  touched but not actually changed.
mysql-test/t/insert_update.test:
  Added a test case for the bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were
  touched but not actually changed.
sql/sql_insert.cc:
  Bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were
  touched but not actually changed.
  
  Now the LAST_INSERT_ID() values is reset to 0 only if there were no rows
  successfully inserted or touched.
2007-03-15 23:21:29 +03:00
unknown
ed80fe2dfb Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug26963


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
2007-03-12 02:24:09 -07:00
unknown
91abf15ed2 Fixed bug #26738: incomplete string values in a result set column
when the column is to be read from a derived table column which 
was specified as a concatenation of string literals.
The bug happened because the Item_string::append did not adjust the
value of Item_string::max_length. As a result of it the temporary 
table column  defined to store the concatenation of literals was 
not wide enough to hold the whole value.



mysql-test/r/subselect.result:
  Added a test case for bug #26738.
mysql-test/t/subselect.test:
  Added a test case for bug #26738.
2007-03-12 01:39:57 -07:00
unknown
13c05162f3 Fixed bug #26963: invalid optimization of the pushdown conditions
after single-row table substitution could lead to a wrong result set.
The bug happened because the function Item_field::replace_equal_field
erroniously assumed that any field included in a multiple equality
with a constant has been already substituted for this constant.
This not true for fields becoming constant after row substitutions
for constant tables.
 


mysql-test/r/select.result:
  Added a test case for bug #26963.
mysql-test/t/select.test:
  Added a test case for bug #26963.
sql/item.cc:
  Fixed bug #26963: invalid optimization of the pushdown conditions
  after single-row table substitution could lead to a wrong result set.
  The bug happened because the function Item_field::replace_equal_field
  erroneously assumed that any field included in a multiple equality
  with a constant has been already substituted for this constant.
  This not true for fields becoming constant after row substitutions
  for constant tables.
2007-03-11 23:34:40 -07:00
unknown
d00731db77 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/WL3527-5.0-opt-merge
2007-03-11 10:10:33 +02:00
unknown
2f774b479b Merge moonbone.local:/mnt/gentoo64/work/15757-bug-5.0-opt-mysql
into  moonbone.local:/mnt/gentoo64/work/25373-bug-5.0-opt-mysql


sql/item_strfunc.cc:
  Auto merged
mysql-test/r/func_str.result:
  SCCS merged
mysql-test/t/func_str.test:
  SCCS merged
2007-03-10 19:57:18 +03:00
unknown
816ea8a379 Bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
When the SUBSTRING() function was used over a LONGTEXT field the max_length of
the SUBSTRING() result was wrongly calculated and set to 0. As the max_length
parameter is used while tmp field creation it limits the length of the result
field and leads to printing an empty string instead of the correct result.

Now the Item_func_substr::fix_length_and_dec() function correctly calculates
the max_length parameter.


mysql-test/t/func_str.test:
  Added a test case for the bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
mysql-test/r/func_str.result:
  Added a test case for the bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
sql/item_strfunc.cc:
  Bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
  Now the Item_func_substr::fix_length_and_dec() function correctly calculates
  the max_length parameter.
2007-03-10 19:55:34 +03:00
unknown
c0a0543545 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/25373-bug-5.0-opt-mysql


mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/union.result:
  Auto merged
sql/item.cc:
  Auto merged
2007-03-10 19:53:59 +03:00
unknown
4d6ad7ac60 Fixed bug #26830: a crash for the query with a subselect containing ROLLUP.
Crash happened because the function get_best_group_min_max detected
joins with ROLLUP incorrectly.


mysql-test/r/olap.result:
  Added a test case for bug #26830.
mysql-test/t/olap.test:
  Added a test case for bug #26830.
2007-03-10 02:47:47 -08:00
unknown
944030aef7 Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
away.

Additional fix for bug#22331. Now Item_field prints its value in the case of
the const field.


mysql-test/r/varbinary.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/union.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/subselect.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/func_test.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/having.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/func_regexp.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/func_str.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/func_default.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/explain.result:
  Corrected test case after fix for bug#22331.
sql/sql_union.cc:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  Cleanup of the SELECT_LEX::order_list list.
sql/item.h:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  Added the print() member function to the Item_field class.
sql/item.cc:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  Added the print() member function to the Item_field class.
2007-03-10 00:29:02 +03:00
unknown
81beab69a4 Merge bk-internal:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/WL3527-5.0-opt-merge


sql/sql_yacc.yy:
  Auto merged
mysql-test/r/select.result:
  merge
mysql-test/t/select.test:
  merge
2007-03-09 16:30:44 +02:00
unknown
ff79cd6870 WL#3527: Extend IGNORE INDEX so places where index is ignored can
be specified
 5.0 part of the fix. Implements IGNORE INDEX FOR JOIN as a synonym
 of IGNORE INDEX for backward compatibility with the 5.1 fix.


mysql-test/r/select.result:
  WL#3527: Extend IGNORE INDEX so places where index is ignored can 
           be specified
  - test case
mysql-test/t/select.test:
  WL#3527: Extend IGNORE INDEX so places where index is ignored can 
           be specified
  - test case
2007-03-09 15:20:06 +02:00
unknown
52fb60dadf Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B26281-5.0-opt
2007-03-09 14:48:19 +02:00
unknown
c7de22a1c7 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B26281-5.0-opt


sql/item_strfunc.cc:
  Auto merged
mysql-test/r/func_str.result:
  resolved test merge conflicts
mysql-test/t/func_str.test:
  resolved test merge conflicts
2007-03-09 13:05:41 +02:00
unknown
29b6d55402 Bug #26281:
Fixed boundry checks in the INSERT() function:
 were one off.


mysql-test/r/func_str.result:
  Bug #26281: test case
mysql-test/t/func_str.test:
  Bug #26281: test case
sql/item_strfunc.cc:
  Bug #26281: fixed boundry checks
2007-03-09 12:47:12 +02:00
unknown
e68df7a1ab Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt


sql/item.cc:
  Auto merged
2007-03-09 02:45:17 -08:00
unknown
413604f907 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug26661
2007-03-09 01:50:17 -08:00
unknown
729bcaf430 Fixed bug #26661: crash when order by clause in a union
construct references invalid name.
Derived tables currently cannot use outer references.
Thus there is no outer context for them.
The 4.1 code takes this fact into account while the 
Item_field::fix_outer_field code of 5.0 lost the check that blocks
any attempts to resolve names in outer context for derived tables.


mysql-test/r/union.result:
  Added a test case for bug #26661.
mysql-test/t/union.test:
  Added a test case for bug #26661.
sql/item.cc:
  Fixed bug #26661.
  Derived tables currently cannot use outer references.
  Thus there is no outer context for them.
  The 4.1 code takes this fact into account while the 
  Item_field::fix_outer_field code of 5.0 lost the check that blocks
  any attempts to resolve names in outer context for derived tables.
2007-03-09 01:45:32 -08:00
unknown
76542acdce Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/hf/work/mrg/mysql-5.0-opt


sql/sql_select.cc:
  Auto merged
2007-03-09 13:44:43 +04:00
unknown
3cd8b8817d Merge mysql.com:/home/hf/work/mrg/mysql-4.1-opt
into  mysql.com:/home/hf/work/mrg/mysql-5.0-opt
2007-03-09 13:39:03 +04:00
unknown
5c1e48c51d aftermerge fix
mysql-test/r/view.result:
  merging
2007-03-09 13:37:06 +04:00
unknown
12af658570 Merge bk@192.168.21.1:mysql-5.0
into  mysql.com:/home/hf/work/mrg/mysql-5.0-opt


mysql-test/r/order_by.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/order_by.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
mysql-test/r/func_str.result:
  merging
mysql-test/r/sp.result:
  merging
mysql-test/r/view.result:
  merging
mysql-test/t/func_str.test:
  merging
mysql-test/t/view.test:
  merging
2007-03-08 21:42:41 +04:00
unknown
0fcd9c2bfb Merge bk@192.168.21.1:mysql-4.1
into  mysql.com:/home/hf/work/mrg/mysql-4.1-opt
2007-03-08 21:14:31 +04:00
unknown
4c0ab891ea sql_select.cc:
Postfix for bug#22331.


sql/sql_select.cc:
  Postfix for bug#22331.
2007-03-08 19:38:21 +03:00
unknown
5130e88e41 Merge bk-internal:/home/bk/mysql-4.1-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-4.1-maint
2007-03-08 15:10:24 +01:00
unknown
d6bd171fd2 Merge pilot.blaudden:/home/msvensson/mysql/mysql-4.1-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint


mysql-test/mysql-test-run.pl:
  Manual merge
2007-03-08 14:55:39 +01:00
unknown
cc379fff6d Merge bk-internal:/home/bk/mysql-5.0-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint


extra/comp_err.c:
  Auto merged
sql/mysqld.cc:
  Auto merged
2007-03-08 13:30:04 +01:00
unknown
0a5780bc03 comp_err.c: return ha_checksum from checksum_format_specifier() - more correct, avoid a compiler warning
extra/comp_err.c:
  return ha_checksum from checksum_format_specifier() - more correct, avoid a compiler warning
2007-03-08 08:15:30 +01:00
unknown
12df5509e7 Merge bk-internal:/home/bk/mysql-5.0-ndb
into  mysql.com:/data0/mysqldev/users/tomas/mysql-5.0-maint
2007-03-08 04:23:19 +01:00
unknown
02fa7a1651 Merge poseidon.mysql.com:/home/tomas/mysql-5.0
into  poseidon.mysql.com:/home/tomas/mysql-5.0-ndb
2007-03-08 08:33:38 +07:00
unknown
1d07e34624 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/50
2007-03-08 02:22:50 +01:00
unknown
270f20ae4f Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/41
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/50
2007-03-08 01:12:09 +01:00
unknown
f2044997d8 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/40
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/41
2007-03-08 01:06:04 +01:00
unknown
8a01882a42 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-build
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/50


scripts/make_binary_distribution.sh:
  Auto merged
2007-03-08 01:00:49 +01:00
unknown
ae8cad4424 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-4.1-build
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/41
2007-03-08 00:59:15 +01:00
unknown
30c1622ec4 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/50
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mrg0306/50


sql/mysqld.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2007-03-07 23:55:25 +01:00
unknown
7a512b029d Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/40
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mrg0306/40
2007-03-07 23:54:52 +01:00
unknown
5501a2915a update test results for bdb_gis after merge of fix for b26038 2007-03-07 23:49:46 +01:00
unknown
245f130858 Merge mysql.com:/home/kent/bk/tmp/mysql-4.1-build
into  mysql.com:/home/kent/bk/tmp/mysql-5.0-build
2007-03-07 23:07:03 +01:00
unknown
dc45145483 Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/kent/bk/tmp/mysql-5.0-build
2007-03-07 23:05:46 +01:00
unknown
4c1312d446 Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/kent/bk/tmp/mysql-4.1-build
2007-03-07 23:04:25 +01:00
unknown
1631f65dfd sql_select.cc:
Postfix for bug#22331 for windows platform.
explain.test, explain.result:
  Cleanup after bugfix#22331.


mysql-test/t/explain.test:
  Cleanup after bugfix#22331.
mysql-test/r/explain.result:
  Cleanup after bugfix#22331.
sql/sql_select.cc:
  Postfix for bug#22331 for windows platform.
2007-03-08 00:27:42 +03:00
unknown
d773874044 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/25373-bug-5.0-opt-mysql


sql/sql_select.cc:
  Auto merged
2007-03-07 22:23:08 +03:00
unknown
6f18c39265 Merge moonbone.local:/mnt/gentoo64/work/22331-bug-5.0-opt-mysql
into  moonbone.local:/mnt/gentoo64/work/25373-bug-5.0-opt-mysql


mysql-test/r/subselect.result:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_lex.cc:
  SCCS merged
2007-03-07 22:22:19 +03:00
unknown
11b533b8be Bug#25373: Stored functions wasn't compared correctly which leads to a wrong
result.

For built-in functions like sqrt() function names are hard-coded and can be
compared by pointer. But this isn't the case for a used-defined stored
functions - names there are dynamical and should be compared as strings.

Now the Item_func::eq() function employs my_strcasecmp() function to compare
used-defined stored functions names.


mysql-test/t/sp.test:
  Added a test case for bug#25373: Stored functions wasn't compared correctly which leads to a wrong result.
mysql-test/r/sp.result:
  Added a test case for bug#25373: Stored functions wasn't compared correctly which leads to a wrong result.
sql/item_func.cc:
  Bug#25373: Stored functions wasn't compared correctly which leads to a wrong
  result.
  Now the Item_func::eq() function employs my_strcasecmp() function to compare
  used-defined stored functions names.
2007-03-07 22:11:57 +03:00
unknown
6de277910b Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
away.

During optimization stage the WHERE conditions can be changed or even
be removed at all if they know for sure to be true of false. Thus they aren't
showed in the EXPLAIN EXTENDED which prints conditions after optimization.

Now if all elements of an Item_cond were removed this Item_cond is substituted
for an Item_int with the int value of the Item_cond.
If there were conditions that were totally optimized away then values of the
saved cond_value and having_value will be printed instead.


mysql-test/t/explain.test:
  Added a test case for the bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away.
mysql-test/r/subselect.result:
  Corrected test case result after fix for bug#22331.
mysql-test/r/func_test.result:
  Corrected test case result after fix for bug#22331.
mysql-test/r/explain.result:
  Added a test case for the bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away.
sql/sql_select.cc:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  Now if all elements of an Item_cond were removed this Item_cond is substituted
  for an Item_int with the int value of the Item_cond.
  If there were conditions that were totally optimized away then values of the
  saved cond_value and having_value will be printed instead.
sql/sql_lex.h:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  The cond_value and the having_value variables are
  added to the SELECT_LEX class.
sql/sql_lex.cc:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  The initialization of the cond_value and the having_value variables.
sql/sql_select.h:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  Now having_value is also stored in the JOIN class.
2007-03-07 21:44:58 +03:00
unknown
e4cdb58013 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug26560


sql/sql_base.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-03-07 07:58:34 -08:00
unknown
83def161de Bug#25222 Win32 HANDLE leak in my_sopen()
- When attempting to associate a Windows File handle to a C run-time file
handle there is an upper bound.  Once reached, the newly created handles
will cause a memory leak since they are not properly associated with a
handle that can later be cleaned up.


mysys/my_open.c:
  Bug#25222 Win32 HANDLE leak in my_sopen()
  - Check for failure in _open_osfhandle and close allocated HANDLE on failure.
2007-03-07 10:46:38 -05:00
unknown
4d6e16f284 A fix for the windows build (harmless warning).
sql/sql_lex.cc:
  A fix for the windows build.
2007-03-07 14:03:44 +03:00
unknown
cbd324d262 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B19342-5.0-opt
2007-03-07 11:55:37 +02:00