Commit graph

12373 commits

Author SHA1 Message Date
unknown
7ab33d5070 Fixed bug #26017.
Objects of the class Item_equal contain an auxiliary member
eval_item of the type cmp_item that is used only for direct 
evaluation of multiple equalities. Currently a multiple equality
is evaluated directly only in the cases when the equality holds
at most for one row in the result set.
The compare collation of eval_item was determined incorectly.
It could lead to returning incorrect results for some queries.


mysql-test/r/join_outer.result:
  Added a test case for bug #26017.
mysql-test/t/join_outer.test:
  Added a test case for bug #26017.
sql/item_cmpfunc.cc:
  Fixed bug #26017.
  Objects of the class Item_equal contain an auxiliary member
  eval_item of the type cmp_item that is used only for direct 
  evaluation of multiple equalities. Currently a multiple equality
  is evaluated directly only in the cases when the equality holds
  at most for one row in the result set.
  The compare collation of eval_item was determined incorrectly.
  It could lead to returning incorrect results for some queries.
sql/item_cmpfunc.h:
  Fixed bug #26017.
  Removed the cmp_collation member from the Item_equal class as useless
  for the current implementation of the class.
2007-02-09 12:54:50 -08:00
unknown
3609c3a4a3 Fixed bug #25931.
View check option clauses were ignored for updates of multi-table
views when the updates could not be performed on fly and the rows
to update had to be put into temporary tables first.



mysql-test/r/view.result:
  Added a test case for bug #25931.
mysql-test/t/view.test:
  Added a test case for bug #25931.
  Adjusted another existed test case to have the correct result.
sql/sql_update.cc:
  Fixed bug #25931.
  View check option clauses were ignored for updates of multi-table
  views when the updates could not be performed on fly and the rows
  to update had to be put into temporary tables first.
  Added the required check to multi_update::do_updates to fix the problem.
2007-02-07 14:41:57 -08:00
unknown
3a54e5930d Fixed bug #26124: SELECT from a view wrapper over a table
with a column of the DATETIME type could return a wrong 
result set if the WHERE clause included a BETWEEN condition
on the column.
Fixed the method Item_func_between::fix_length_and_dec
where the aggregation type for BETWEEN predicates calculated
incorrectly if the first argument was a view column of the
DATETIME type.


mysql-test/r/view.result:
  Added a test case for bug #26124.
mysql-test/t/view.test:
  Added a test case for bug #26124.
2007-02-07 00:18:36 -08:00
unknown
976f0a391c Bug#19978: INSERT .. ON DUPLICATE erroneously reports some records were
updated.

INSERT ... ON DUPLICATE KEY UPDATE reports that a record was updated when
the duplicate key occurs even if the record wasn't actually changed
because the update values are the same as those in the record.

Now the compare_record() function is used to check whether the record was
changed and the update of a record reported only if the record differs
from the original one.


sql/sql_update.cc:
  Bug#19978: INSERT .. ON DUPLICATE erroneously reports some records were
  updated.
  The compare_record() function was changed to non-static one.
sql/sql_insert.cc:
  Bug#19978: INSERT .. ON DUPLICATE erroneously reports some records were
  updated.
  Now the compare_record() function is used to check whether the record was
  changed and the update of a record reported only if the record differs
  from the original one.
sql/mysql_priv.h:
  Bug#19978: INSERT .. ON DUPLICATE erroneously reports some records were
  updated.
  Added the prototype of the compare_record() function.
mysql-test/t/insert_select.test:
  Added a test case for bug#19978: INSERT .. ON DUPLICATE erroneously reports
  some records were updated.
mysql-test/r/insert_select.result:
  Added a test case for bug#19978: INSERT .. ON DUPLICATE erroneously reports
  some records were updated.
2007-02-07 00:46:03 +03:00
unknown
c35ceeca9e Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
Ignoring error codes from type conversion allows default (wrong) values to
 go unnoticed in the formation of index search conditions.
 Fixed by correctly checking for conversion errors.


mysql-test/r/select.result:
  Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
   - test case
mysql-test/t/select.test:
  Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
   - test case
sql/field.h:
  Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
   - don't ignore coversion errors
sql/field_conv.cc:
  Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
   - don't ignore coversion errors
sql/item.cc:
  Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
   - don't ignore coversion errors
2007-02-06 11:08:57 +02:00
unknown
1534bb792b Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24035
2007-02-03 10:37:45 -08:00
unknown
e0d8e8fd09 Fix bug #24035.
This performance degradation for UPDATEs could be observed in the update
statements for which the search key cannot be converted to any valid
value of the type of the search column, like for a  the condition
int_fld=99999999999999999999999999, though it can be guaranteed here
that there is no row with such a key value. 


mysql-test/r/update.result:
  Added a test case for bug #24035.
mysql-test/t/update.test:
  Added a test case for bug #24035.
sql/opt_range.cc:
  Fix bug #24035.
  This performance degradation for could be observed in the update
  statements for which the search key cannot be converted to any valid
  value of the type of the search column, like for a  the condition
  int_fld=99999999999999999999999999, though it can be guaranteed here
  that there is no row with such a key value. 
  Now the function get_mm_leaf creates trees of the type SEL_ARG::IMPOSSIBLE 
  for such conditions that tells the range scan not to perform any search
  at all.
2007-02-02 15:22:10 -08:00
unknown
9bb750f5e8 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-02-02 15:21:14 +04:00
unknown
a308304607 Bug#23299 Some queries against INFORMATION_SCHEMA with subqueries fail
additional call of file->extra() method with HA_EXTRA_NO_CACHE parameter


mysql-test/r/information_schema.result:
  test result
mysql-test/t/information_schema.test:
  test case
sql/sql_show.cc:
  additional call of file->extra() method with HA_EXTRA_NO_CACHE parameter
2007-02-01 19:12:45 +04:00
unknown
1ff126e935 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B23556-5.0-opt
2007-02-01 13:26:25 +02:00
unknown
0c52332512 trigger.result:
merge of the 5.0-opt tree


mysql-test/r/trigger.result:
  merge of the 5.0-opt tree
2007-02-01 13:25:50 +02:00
unknown
020e82c650 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B23556-5.0-opt


mysql-test/t/trigger.test:
  Auto merged
sql/sql_delete.cc:
  Auto merged
2007-02-01 11:07:17 +02:00
unknown
6bddf2a01f Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B25551-5.0-opt


sql/sql_select.cc:
  Auto merged
2007-02-01 10:50:41 +02:00
unknown
c15b2e4152 Fixed bug #25407.
The bug could cause choosing a sub-optimal execution plan for 
a single-table query if a unique index with many null keys were 
defined for the table. 
It happened because the code of the check_quick_keys function 
made an assumption that any key may occur in an unique index 
only once. Yet this is not true for keys with nulls that may 
have multiple occurrences in the index.


mysql-test/r/null_key.result:
  Fixed bug #25407
  Adjusted result after the fix.
mysql-test/r/select.result:
  Added a test case for bug #25407.
mysql-test/t/select.test:
  Added a test case for bug #25407.
2007-01-31 19:31:36 -08:00
unknown
0375a7a870 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/hf/work/25973/my50-25973
2007-01-31 19:56:52 +04:00
unknown
41f862e19f Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B25575-5.0-opt


sql/mysql_priv.h:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
2007-01-31 16:12:47 +02:00
unknown
fbc16a85c2 BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
Two problems here:

 Problem 1:

 While constructing the join columns list the optimizer does as follows:
  1. Sets the join_using_fields/natural_join members of the right JOIN 
   operand.
  2. Makes a "table reference" (TABLE_LIST) to parent the two tables.
  3. Assigns the join_using_fields/is_natural_join of the wrapper table
   using join_using_fields/natural_join of the rightmost table
  4. Sets join_using_fields to NULL for the right JOIN operand.
  5. Passes the parent table up to the same procedure on the upper 
   level.

 Step 1 overrides the the join_using_fields that are set for a nested 
 join wrapping table in step 4.
 Fixed by making a designated variable SELECT_LEX::prev_join_using to 
 pass the data from step 1 to step 4 without destroying the wrapping 
 table data.

 Problem 2:

 The optimizer checks for ambiguous columns while transforming 
 NATURAL JOIN/JOIN USING to JOIN ON. While doing that there was no
 distinction between columns that are used in the generated join
 condition (where ambiguity can be checked) and the other columns
 (where ambiguity can be checked only when resolving references
 coming from outside the JOIN construct itself).
 Fixed by allowing the non-USING columns to be present in multiple 
 copies in both sides of the join and moving the ambiguity check 
 to the place where unqualified references to the join columns are
 resolved (find_field_in_natural_join()).


mysql-test/r/join_nested.result:
  BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
   - test case
mysql-test/t/join_nested.test:
  BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
   - test case
sql/mysql_priv.h:
  BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
   - use SELECT_LEX to store the ref to JOIN USING list needed by the 
     parser
sql/sql_base.cc:
  BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
   - proper check for duplicate cols
   - more detailed debug output
sql/sql_lex.h:
  BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
   - use SELECT_LEX to store the ref to JOIN USING list needed by the 
     parser
sql/sql_parse.cc:
  BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
   - proper check for duplicate cols in JOIN USING
sql/sql_yacc.yy:
  BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
   - use SELECT_LEX to store the ref to JOIN USING list needed by the 
     parser
sql/table.cc:
  BUG#25575: ERROR 1052 (Column in from clause is ambiguous) with sub-join
   - return null if no table ref (as in nested join columns).
2007-01-31 16:04:38 +02:00
unknown
e8040084a5 bug #25973 (ps_1general.test fails in embedded server)
mysql-test/t/ps_1general.test:
  replace_result fixed
2007-01-31 16:45:33 +04:00
unknown
d01ec5e727 Bug #25551: inconsistent behaviour in grouping NULL, depending on index type
The optimizer takes away columns from GROUP BY/DISTINCT if they constitute
 all the parts of an unique index.
 However if some of the columns can contain NULLs this cannot be done 
(because an UNIQUE index can have multiple rows with NULL values).
 Fixed by not using UNIQUE indexes with nullable columns to remove
 grouping columns from GROUP BY/DISTINCT.


mysql-test/r/distinct.result:
  Bug #25551: inconsistent behaviour in grouping NULL, depending on index type
   - test case
mysql-test/t/distinct.test:
  Bug #25551: inconsistent behaviour in grouping NULL, depending on index type
   - test case
sql/sql_select.cc:
  Bug #25551: inconsistent behaviour in grouping NULL, depending on index type
   - UNIQUE NULL indices don't guarantee GROUP BY/DISTINCT.
2007-01-31 10:18:26 +02:00
unknown
0142be558f gen_lex_hash.cc:
If inserting a GPL header, include a complete one
Makefile.am, mysql.dsw, mysql.sln:
  Removed C version of mysql-test-run
mysql.spec.sh:
  Specify GPL license only in GPL sources
.del-my_manage.h:
  Delete: mysql-test/my_manage.h
mysql.spec.sh:
  Added GPL header
.del-mysql_test_run_new.c:
  Delete: mysql-test/mysql_test_run_new.c
.del-mysql_test_run_new.dsp:
  Delete: VC++Files/mysql-test/mysql_test_run_new.dsp
.del-my_create_tables.c:
  Delete: mysql-test/my_create_tables.c
.del-mysql_test_run_new_ia64.dsp:
  Delete: VC++Files/mysql-test/mysql_test_run_new_ia64.dsp
msql2mysql.sh:
  Use up-to-date GPL header
.del-mysql_test_run_new.vcproj:
  Delete: VC++Files/mysql-test/mysql_test_run_new.vcproj
.del-my_manage.c:
  Delete: mysql-test/my_manage.c


scripts/msql2mysql.sh:
  Use up-to-date GPL header
support-files/mysql.spec.sh:
  Added GPL header
sql/gen_lex_hash.cc:
  If inserting a GPL header, include a complete one
BitKeeper/deleted/.del-mysql_test_run_new.c:
  Delete: mysql-test/mysql_test_run_new.c
BitKeeper/deleted/.del-mysql_test_run_new.dsp:
  Delete: VC++Files/mysql-test/mysql_test_run_new.dsp
BitKeeper/deleted/.del-mysql_test_run_new.vcproj:
  Delete: VC++Files/mysql-test/mysql_test_run_new.vcproj
BitKeeper/deleted/.del-mysql_test_run_new_ia64.dsp:
  Delete: VC++Files/mysql-test/mysql_test_run_new_ia64.dsp
BitKeeper/deleted/.del-my_create_tables.c:
  Delete: mysql-test/my_create_tables.c
BitKeeper/deleted/.del-my_manage.c:
  Delete: mysql-test/my_manage.c
BitKeeper/deleted/.del-my_manage.h:
  Delete: mysql-test/my_manage.h
VC++Files/mysql.dsw:
  Removed C version of mysql-test-run
VC++Files/mysql.sln:
  Removed C version of mysql-test-run
mysql-test/Makefile.am:
  Removed C version of mysql-test-run
2007-01-31 00:06:42 +01:00
unknown
21d915c071 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B25643-5.0-opt
2007-01-30 19:30:42 +02:00
unknown
3cb3a9a149 Bug #25643: SEC_TO_TIME function problem
Checking for NULL before calling the val_xxx()
 methods only checks for such arguments that are 
 known to be NULLs at compile time. 
 The arguments that may or may not contain
 NULLs (e.g. function calls and possibly others)
 are not checked at all.
 Fixed by first calling the val_xxx() method and
 then checking for null in SEC_TO_TIME().
 In addition QUARTER() was not returning 0 (as all the 
 val_int() functions do when processing a NULL value).


mysql-test/r/func_time.result:
  Bug #25643: SEC_TO_TIME function problem
   - test case
mysql-test/t/func_time.test:
  Bug #25643: SEC_TO_TIME function problem
   - test case
sql/item_timefunc.cc:
  Bug #25643: SEC_TO_TIME function problem
   - null handling fixed for QUARTER() and SEC_TO_TIME()
2007-01-30 17:43:34 +02:00
unknown
1495924319 Fixed bug #24420.
Objects of the classes Item_func_is_not_null_test and Item_func_trig_cond
must be transparent for the method Item::split_sum_func2 as these classes
are pure helpers. It means that the method Item::split_sum_func2 should
look at those objects as at pure wrappers.


mysql-test/r/subselect3.result:
  Added a test case for bug #24420.
mysql-test/t/subselect3.test:
  Added a test case for bug #24420.
2007-01-26 17:10:45 -08:00
unknown
4f118f1d76 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24653


sql/item.h:
  Auto merged
2007-01-26 09:33:19 -08:00
unknown
92a7c1ed9c Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.0


sql/item.h:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
2007-01-26 16:36:50 +04:00
unknown
483a41bbb7 Merge olga.mysql.com:/home/igor/dev-opt/mysql-4.1-opt-bug24653
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24653


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/subselect.result:
  Manual merge
mysql-test/t/subselect.test:
  Manual merge
sql/filesort.cc:
  Manual merge
sql/item_cmpfunc.h:
  Manual merge
sql/item_subselect.cc:
  Manual merge
2007-01-25 21:01:28 -08:00
unknown
da561a802c Fixed bug #24653.
The bug report has demonstrated the following two problems.
1. If an ORDER/GROUP BY list includes a constant expression being 
optimized away and, at the same time, containing single-row
subselects that return more that one row, no error is reported.
Strictly speaking the standard allows to ignore error in this case.
Yet, now a corresponding fatal error is reported in this case.
2. If a query requires sorting by expressions containing single-row
subselects that, however, return more than one row, then the execution
of the query may cause a server crash. 
To fix this some code has been added that blocks execution of a subselect
item in case of a fatal error in the method Item_subselect::exec.


mysql-test/r/subselect.result:
  Added a test cases for bug #24653.
mysql-test/t/subselect.test:
  Added a test cases for bug #24653.
sql/filesort.cc:
  Fixed bug #24653.
  Added a check for fatal error after reading the next row from the table
  in the function find_all_keys.
sql/item.cc:
  Fixed bug #24653.
  Down-ported calculation of the attribute with_subselect of for Item objects.
sql/item.h:
  Fixed bug #24653.
  Down-ported calculation of the attribute with_subselect of for Item objects.
sql/item_cmpfunc.cc:
  Fixed bug #24653.
  Down-ported calculation of the attribute with_subselect of for Item objects.
sql/item_cmpfunc.h:
  Fixed bug #24653.
  Down-ported calculation of the attribute with_subselect of for Item objects.
sql/item_func.cc:
  Fixed bug #24653.
  Down-ported calculation of the attribute with_subselect of for Item objects.
sql/item_subselect.cc:
  Fixed bug #24653.
  Added a check for fatal error in the method Item_subselect::exec
  to block evaluation of subselects in erroneous situations.
  Down-ported calculation of the attribute with_subselect of for Item objects.
sql/sql_select.cc:
  Fixed bug #24653.
  Added a check to verify that any constant expression used
  in ORDER BY and/or GROUP BY lists which is optimized away
  does not contain subselects returning more than one row.
  If it does a fatal error is reported.
2007-01-25 18:44:35 -08:00
unknown
ea41474bf8 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mockturtle.local:/home/dlenev/src/mysql-5.0-merge
2007-01-25 11:26:18 +03:00
unknown
24903ed56c Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bug8804-r12


sql/mysqld.cc:
  Auto merged
2007-01-25 02:28:53 +03:00
unknown
2ed7eaf564 Merge mysql.com:/home/svoj/devel/bk/mysql-5.0
into  mysql.com:/home/svoj/devel/mysql/merge/mysql-5.0-engines


mysql-test/t/myisam.test:
  Auto merged
2007-01-25 01:31:58 +04:00
unknown
c26ffedb86 Merge mysql.com:/home/svoj/devel/bk/mysql-5.0
into  mysql.com:/home/svoj/devel/mysql/merge/mysql-5.0-engines


mysql-test/r/symlink.result:
  Auto merged
mysql-test/t/symlink.test:
  Auto merged
sql/table.cc:
  Auto merged
mysql-test/r/myisam.result:
  Manually merged.
mysql-test/t/myisam.test:
  Manually merged.
2007-01-25 01:26:57 +04:00
unknown
130523af45 BUG#24127: merge fixes: If subselect is a union, dont allocate several
identical pushed_cond_guards arrays. Allocate only one always.


mysql-test/r/subselect.result:
  BUG#24127: merge
mysql-test/t/subselect3.test:
  BUG#24127: merge
2007-01-24 22:23:50 +03:00
unknown
259a465822 Disabling back im_daemon_life_cycle.test, which was temporarily enabled in
the team tree for additional investigation.
2007-01-24 22:11:27 +03:00
unknown
7b109de61a Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mockturtle.local:/home/dlenev/src/mysql-5.0-merge


mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
2007-01-24 19:33:06 +03:00
unknown
dfeac169a6 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bug8804-r12


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/subselect.result:
  Manual Merge
2007-01-24 19:13:28 +03:00
unknown
e396abc986 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-01-24 19:24:16 +04:00
unknown
6bb5fd6b28 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-engines
into  chilla.local:/home/mydev/mysql-5.0-bug24607


mysql-test/r/myisam.result:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
2007-01-24 15:52:19 +01:00
unknown
ccb002dbc2 Bug#24607 - MyISAM pointer size determined incorrectly
After merge fix
2007-01-24 13:29:46 +01:00
unknown
4f73c75fba Merge chilla.local:/home/mydev/mysql-4.1-bug24607
into  chilla.local:/home/mydev/mysql-5.0-bug24607


mysql-test/r/myisam.result:
  Manual merged
mysql-test/t/myisam.test:
  Manual merged
2007-01-24 13:26:06 +01:00
unknown
112ef50f28 Bug#24607 - MyISAM pointer size determined incorrectly
Fixed test. On 32-bit machines which compile without
-DBIG_TABLES, MAX_ROWS is truncated to a 32-bit value.
Using a value below 4G is portable.


mysql-test/r/myisam.result:
  Bug#24607 - MyISAM pointer size determined incorrectly
  Fixed test results.
2007-01-24 13:17:01 +01:00
unknown
bb5dccf260 Merge kahlann.erinye.com:/home/df/mysql/build/mysql-5.0
into  kahlann.erinye.com:/home/df/mysql/build/mysql-5.0-build-work


sql/ha_ndbcluster.cc:
  Auto merged
2007-01-24 09:24:52 +01:00
unknown
5e0fd916f1 After merge fix. 2007-01-24 11:53:09 +04:00
unknown
02a9f2f719 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  poseidon.mysql.com:/home/tomas/mysql-5.0-ndb


sql/mysqld.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
2007-01-24 09:13:47 +07:00
unknown
bf12442461 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt


sql/item_func.cc:
  Auto merged
2007-01-23 17:04:01 -08:00
unknown
1f4d8ba085 Merge bk-internal.mysql.com:/home/bk/mysql-4.1-engines
into  chilla.local:/home/mydev/mysql-4.1-bug24607


mysql-test/r/myisam.result:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
2007-01-23 22:27:03 +01:00
unknown
4bec8b037f Merge bk-internal.mysql.com:/home/bk/mysql-5.0-engines
into  chilla.local:/home/mydev/mysql-5.0-bug24607


mysql-test/r/myisam.result:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
2007-01-23 20:19:19 +01:00
unknown
5d9d649310 Post-merge fix. 2007-01-23 10:11:53 -08:00
unknown
8dc8acbb09 Merge olga.mysql.com:/home/igor/mysql-4.1-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt


mysql-test/r/fulltext_left_join.result:
  Auto merged
mysql-test/t/fulltext_left_join.test:
  Auto merged
sql/item_func.cc:
  Auto merged
2007-01-23 09:56:06 -08:00
unknown
5f544ed032 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mockturtle.local:/home/dlenev/src/mysql-5.0-bg24491


sql/item.h:
  Auto merged
mysql-test/r/ps.result:
  Manual merge.
mysql-test/t/ps.test:
  Manual merge.
2007-01-23 15:57:46 +03:00
unknown
1dead07d14 Proposed fix for bug#24491 "using alias from source table in insert ...
on duplicate key".

INSERT ... SELECT ... ON DUPLICATE KEY UPDATE which was used in
stored routine or as prepared statement and which in its ON DUPLICATE
KEY clause erroneously tried to assign value to a column mentioned only
in its SELECT part was properly emitting error on the first execution
but succeeded on the second and following executions.

Code which is responsible for name resolution of fields mentioned in
UPDATE clause (e.g. see select_insert::prepare()) modifies table list
and Name_resolution_context used in this process. It uses
Name_resolution_context_state::save_state/restore_state() to revert
these modifications. Unfortunately those two methods failed to revert
properly modifications to TABLE_LIST::next_name_resolution_table
and this broke name resolution process for successive executions.

This patch fixes Name_resolution_context_state::save_state/restore_state()
in such way that it properly handles TABLE_LIST::next_name_resolution_table.


mysql-test/r/ps.result:
  Added test case for bug#24491 "using alias from source table in insert ...
  on duplicate key"
mysql-test/r/sp-error.result:
  Added test case for bug#24491 "using alias from source table in insert ...
  on duplicate key"
mysql-test/t/ps.test:
  Added test case for bug#24491 "using alias from source table in insert ...
  on duplicate key"
mysql-test/t/sp-error.test:
  Added test case for bug#24491 "using alias from source table in insert ...
  on duplicate key"
sql/item.h:
  Name_resolution_context::save_state/restore_state():
    At the moment these methods are used only by code implementing
    INSERT and INSERT ... SELECT statements. This code doesn't modify
   'next_name_resolution_table' member of table list element
    corresponding to the first table of SELECT clause (pointed by
    'first_name_resolution_table'). But it modifies table list element
    corresponding to the target table of INSERT (pointed by 'table_list')
    So these methods were changed to reflect this.
2007-01-23 15:03:48 +03:00