Commit graph

31810 commits

Author SHA1 Message Date
unknown
2aeec864e2 Merge macbook.gmz:/Users/kgeorge/mysql/work/B16792-4.1-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B16792-5.0-opt


mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
sql/opt_sum.cc:
  Auto merged
mysql-test/r/func_group.result:
  merge 4.1->5.0 for bug #16792
mysql-test/t/func_group.test:
  merge 4.1->5.0 for bug #16792
sql/sql_select.cc:
  merge 4.1->5.0 for bug #16792
2006-09-05 17:09:12 +03:00
unknown
09df2612b2 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B21392-5.0-opt


sql/sql_yacc.yy:
  Auto merged
2006-09-04 19:21:25 +03:00
unknown
18ed9144bb Merge macbook.gmz:/Users/kgeorge/mysql/work/B21392-4.1-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B21392-5.0-opt


mysql-test/t/delete.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/delete.result:
  merge 4.1->5.0
sql/sql_parse.cc:
  merge 4.1->5.0
2006-09-04 18:45:48 +03:00
unknown
1431966d02 Bug #21392: multi-table delete with alias table name fails with
1003: Incorrect table name
in multi-table DELETE the set of tables to delete from actually 
references then tables in the other list, e.g:
DELETE alias_of_t1 FROM t1 alias_of_t1 WHERE ....
is a valid statement.
So we must turn off table name syntactical validity check for alias_of_t1 
because it's not a table name (even if it looks like one).
In order to do that we add a special flag (TL_OPTION_ALIAS) to 
disable the name checking for the aliases in multi-table DELETE.


mysql-test/r/delete.result:
  Bug #21392: multi-table delete with alias table name fails with
              1003: Incorrect table name
   - test case
mysql-test/t/delete.test:
  Bug #21392: multi-table delete with alias table name fails with
              1003: Incorrect table name
   - test case
sql/mysql_priv.h:
  Bug #21392: multi-table delete with alias table name fails with
              1003: Incorrect table name
   - add a special flag to disable the name checking for the aliases
     in multi-table DELETE
sql/sql_parse.cc:
  Bug #21392: multi-table delete with alias table name fails with
              1003: Incorrect table name
   - add a special flag to disable the name checking for the aliases
     in multi-table DELETE
sql/sql_yacc.yy:
  Bug #21392: multi-table delete with alias table name fails with
              1003: Incorrect table name
   - add a special flag to disable the name checking for the aliases
     in multi-table DELETE
2006-09-04 18:40:30 +03:00
unknown
12279f7cce Merge rurik.mysql.com:/home/igor/mysql-5.0-opt
into  rurik.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug16081
2006-09-04 04:57:46 -07:00
unknown
a0e959271d Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B14654-5.0-opt


mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2006-09-04 11:34:32 +03:00
unknown
a53f3d0f1a Fixed bug #16081: row equalities were not taken into
account by the optimizer.
Now all row equalities are converted into conjunctions of
equalities between row elements. They are taken into account
by the optimizer together with the original regular equality
predicates.


mysql-test/r/join_outer.result:
  Adjusted results after fix for bug #16081.
mysql-test/r/row.result:
  Added a test cases for bug #16081.
mysql-test/t/row.test:
  Added a test cases for bug #16081.
sql/sql_list.h:
  Corrected the copy constructor for the class base_list.
  The previous implementation resulted in creation of an
  inconsistent base_list if the source list was empty.
2006-09-01 04:23:04 -07:00
unknown
efa8e33075 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bug21477-look-64bit
2006-09-01 14:14:50 +04:00
unknown
dd6dc7adea BUG#21477 "memory overruns for certain kinds of subqueries":
make st_select_lex::setup_ref_array() take into account that 
Item_sum-descendant objects located within descendant SELECTs
may be added into ref_pointer_array.


sql/item_sum.cc:
  BUG#21477 "memory overruns for certain kinds of subqueries":
  Make SELECT_LEX::n_sum_items contain # of Item_sum-derived objects
  that exist within this SELECT.
sql/sql_lex.h:
  BUG#21477 "memory overruns for certain kinds of subqueries":
  Add SELECT_LEX::n_sum_items and SELECT_LEXT::n_child_sum_items.
sql/sql_yacc.yy:
  BUG#21477 "memory overruns for certain kinds of subqueries":
  Make SELECT_LEX::n_sum_items contain # of Item_sum-derived objects
  that exist within this SELECT.
2006-09-01 13:23:43 +04:00
unknown
a1d03bd632 Merge rurik.mysql.com:/home/igor/mysql-5.0-opt
into  rurik.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug16249
2006-08-31 08:58:26 -07:00
unknown
c9bba13aee Bug#14654 : Cannot select from the same table twice within a UNION statement
Made the parser to support parenthesis around UNION branches.
 This is done by amending the rules of the parser so it generates the correct
 structure.
 Currently it supports arbitrary subquery/join/parenthesis operations in the 
 EXISTS clause. 
 In the IN/scalar subquery case it will allow adding nested parenthesis only 
 if there is an UNION clause after the parenthesis. Otherwise it will just  
 treat the multiple nested parenthesis as a scalar expression.
 It adds extra lex level for ((SELECT ...) UNION ...) to accommodate for the
 UNION clause.


mysql-test/r/subselect.result:
  Bug#14654 : Cannot select from the same table twice within a UNION statement
   - test cases
mysql-test/t/subselect.test:
  Bug#14654 : Cannot select from the same table twice within a UNION statement
   - test cases
sql/sql_yacc.yy:
  Bug#14654 : Cannot select from the same table twice within a UNION statement
   - shuffle around the rules for the parenthesis in subselect
2006-08-31 18:00:25 +03:00
unknown
c4c36e17ac Fixed bug #16249: different results for a range with an without index
when a range condition use an invalid DATETIME constant.
Now we do not use invalid DATETIME constants to form end keys for
range intervals: range analysis just ignores predicates with such
constants.  


mysql-test/r/query_cache.result:
  Adjusted result warnings when adding a fix for bug #16249.
mysql-test/r/range.result:
  Added a test case for bug #16249.
mysql-test/t/range.test:
  Added a test case for bug #16249.
2006-08-31 07:27:34 -07:00
unknown
c17b36d984 Merge moonbone.local:/work/tmp_merge-4.1-opt-mysql
into  moonbone.local:/work/tmp_merge-5.0-mysql
2006-08-27 00:32:14 +04:00
unknown
85c064f6b1 Merge moonbone.local:/work/tmp_merge-4.1-mysql
into  moonbone.local:/work/tmp_merge-4.1-opt-mysql
2006-08-26 23:11:34 +04:00
unknown
cf9a718252 Merge moonbone.local:/work/tmp_merge-5.0-opt-mysql
into  moonbone.local:/work/tmp_merge-5.0-mysql


mysql-test/r/view.result:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
2006-08-26 22:17:34 +04:00
unknown
7e9ed378f1 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bug16255-merge
2006-08-25 14:44:28 +04:00
unknown
75865af64b Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt
2006-08-25 02:18:30 -07:00
unknown
f121994de8 Fixed bug #21390: wrong estimate of rows after elimination of
const tables. This resulted in choosing extremely inefficient
execution plans in same cases when distribution of data in
joined were skewed (see the customer test case for the bug).



mysql-test/r/select.result:
  Added a test case for bug #21390: wrong estimate of rows
  after elimination of const tables.
  Includded a test case that checks the code added by the patch
  that handles outer joins with no matches after substitution of
  a const table in an efficient way.
mysql-test/t/select.test:
  Added a test case for bug #21390: wrong estimate of rows
  after elimination of const tables.
  Included a test case that checks the code added by the patch
  that handles outer joins with no matches after substitution of
  a const table in an efficient way.
sql/sql_select.cc:
  Fixed bug #21390: wrong estimate of rows after elimination of
  const tables. This resulted in choosing extremely inefficient
  execution plans in same cases when distribution of data in
  joined were skewed (see the customer test case for the bug).
  Also added the code to handle outer joins with no matches after
  substitution of a const table in an efficient way. 
  Corrected calculation of the null rejecting key conditions.
2006-08-25 02:17:41 -07:00
unknown
da2e23f183 opt_range.cc:
Corrected fix for bug#18165


sql/opt_range.cc:
  Corrected fix for bug#18165
2006-08-25 00:23:42 +04:00
unknown
84a6539345 opt_range.cc:
Corrected fix for bug#18165


sql/opt_range.cc:
  Corrected fix for bug#18165
2006-08-24 23:16:54 +04:00
unknown
251409bbf3 BUG#16255: Merge to 5.0 2006-08-24 20:56:28 +04:00
unknown
f895a16c72 BUG#16255: Post-review fixes: adjust the testcase.
mysql-test/r/subselect.result:
  BUG#16255: A proper testcase
mysql-test/t/subselect.test:
  BUG#16255: A proper testcase
2006-08-24 19:16:27 +04:00
unknown
c74c819533 Bug #16255: Subquery in WHERE (the cset by Georgi Kodinov)
Must not use Item_direct_ref in HAVING because it points to
 the new value (witch is not yet calculated for the first row).


mysql-test/r/subselect.result:
  Bug #16255: Subquery in where
   - test case
mysql-test/t/subselect.test:
  Bug #16255: Subquery in where
   - test case
sql/item_subselect.cc:
  Bug #16255: Subquery in where
   Must not use Item_direct_ref in HAVING because it points to
   the new value (witch is not yet calculated for the first row).
2006-08-24 19:14:36 +04:00
unknown
d0394c7070 view.result, view.test:
Corrected test case for the bug#21261
sql_parse.cc:
  Corrected fix for bug#21261


mysql-test/t/view.test:
  Corrected test case for the bug#21261
mysql-test/r/view.result:
  Corrected test case for the bug#21261
sql/sql_parse.cc:
  Corrected fix for bug#21261
2006-08-24 03:05:13 +04:00
unknown
e8bb0c9295 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/work/21475-fix-5.0-opt-mysql
2006-08-23 01:04:00 +04:00
unknown
d8c9de79f4 item_cmpfunc.cc, item.cc:
Additional fix for bug #21475
item_func.h, item_func.cc:
  Additional fix for bug#16861


sql/item_func.h:
  Additional fix for bug#16861
sql/item_func.cc:
  Additional fix for bug#16861
sql/item_cmpfunc.cc:
  Additional fix for bug #21475
sql/item.cc:
  Additional fix for bug #21475
2006-08-23 01:03:28 +04:00
unknown
f40b6c273c Merge salvation.intern.azundris.com:/home/tnurnberg/work/mysql-5.0-maint-20411
into  salvation.intern.azundris.com:/home/tnurnberg/work/mysql-5.0-maint-20987
2006-08-22 17:27:36 +02:00
unknown
e0a6e183a2 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  salvation.intern.azundris.com:/home/tnurnberg/work/mysql-5.0-maint-20987
2006-08-22 17:22:46 +02:00
unknown
7d70273e08 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0
2006-08-22 10:32:07 -04:00
unknown
bbda4dd304 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rurik.mysql.com:/home/igor/mysql-5.0-opt
2006-08-22 07:09:11 -07:00
unknown
3a23139aa4 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  sunlight.local:/local_work/16861-bug-5.0-mysql


sql/sql_select.cc:
  Auto merged
2006-08-22 17:39:18 +04:00
unknown
c623e54fb8 Fixed bug#16861: User defined variable can have a wrong value if a tmp table was
used.

Sorting by RAND() uses a temporary table in order to get a correct results.
User defined variable was set during filling the temporary table and later
on it is substituted for its value from the temporary table. Due to this
it contains the last value stored in the temporary table.

Now if the result_field is set for the Item_func_set_user_var object it 
updates variable from the result_field value when being sent to a client.

The Item_func_set_user_var::check() now accepts a use_result_field
parameter. Depending on its value the result_field or the args[0] is used
to get current value.


mysql-test/r/user_var.result:
  Added a test case for bug#16861: User defined variable can have a wrong value if a tmp table was used.
mysql-test/t/user_var.test:
  Added a test case for bug#16861: User defined variable can have a wrong value if a tmp table was used.
sql/item_func.cc:
  Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
  Now if the result_field is set for the Item_func_set_user_var object it 
  updates variable from the result_field value when being sent to a client.
  
  The Item_func_set_user_var::check() now accepts a use_result_field
  parameter. Depending on its value the result_field or the args[0] is used
  to get current value.
sql/item_func.h:
  Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
  Added a new SUSERVAR_FUNC function type.
  Updated the Item_func_set_user_var::check() function declaration.
  Added the Item_func_set_user_var::send() member function.
sql/set_var.cc:
  Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
  Modified to use updated Item_func_set_user_var::check() function.
sql/sql_class.cc:
  Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
  Modified to use updated Item_func_set_user_var::check() function.
sql/sql_select.cc:
  Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
  Now an Item_func_set_user_var object isn't substituted for an Item_field object after filling a temporary table.
2006-08-22 17:37:41 +04:00
unknown
8776a1e185 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/work/21475-bug-5.0-opt-mysql
2006-08-22 17:18:00 +04:00
unknown
cdd9147ee2 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  salvation.intern.azundris.com:/home/tnurnberg/work/mysql-5.0-maint-20411


sql/sql_acl.cc:
  Auto merged
2006-08-22 14:31:57 +02:00
unknown
97e0f59b3b Bug#20411: "GRANT ... REQUIRE ISSUER nnn AND SUBJECT mmm" fails to require both
when X.509 subject was required for a connect, we tested whether it was the right
one, but did not refuse the connexion if not. fixed.

(corrected CS now --replace_results socket-path)


mysql-test/r/openssl_1.result:
  Bug#20411: "GRANT ... REQUIRE ISSUER nnn AND SUBJECT mmm" fails to require both
  
  test not only whether we can connect with a correct X.509 subject when one is
  required, but also assure that we can't without one.
mysql-test/t/openssl_1.test:
  Bug#20411: "GRANT ... REQUIRE ISSUER nnn AND SUBJECT mmm" fails to require both
  
  test not only whether we can connect with a correct X.509 subject when one is
  required, but also assure that we can't without one.
sql/sql_acl.cc:
  Bug#20411: "GRANT ... REQUIRE ISSUER nnn AND SUBJECT mmm" fails to require both
  
  actually refuse connexion if X.509 is required, but does not match. kudos to Al Smith.
2006-08-22 14:29:48 +02:00
unknown
4f630bf3eb Merge salvation.intern.azundris.com:/home/tnurnberg/work/mysql-4.1-maint-20987
into  salvation.intern.azundris.com:/home/tnurnberg/work/mysql-5.0-maint-20987


sql/item_timefunc.cc:
  Auto merged
mysql-test/r/func_time.result:
  manual merge
mysql-test/t/func_time.test:
  manual merge
2006-08-22 14:03:52 +02:00
unknown
38558705d0 Fixed bug 16201: a memory corruption causing crashes due to a too small
buffer for a MY_BITMAP temporary buffer allocated on stack in the
function get_best_covering_ror_intersect().
Now the buffer of a proper size is allocated by a request from this
function in mem_root.

We succeeded to demonstrate the bug only on Windows with a very large
database. That's why no test case is provided for in the patch.


sql/opt_range.cc:
  Fixed bug 16201: a memory corruption causing crashes due to a too small 
  buffer for a MY_BITMAP temporary buffer allocated on stack in the
  function get_best_covering_ror_intersect().
  Now the buffer of a proper size is allocated by a request from this
  function in mem_root.
2006-08-22 04:14:39 -07:00
unknown
adb31669de Fix compile errors in VC++ 7.0: fix typo made in previous cset 2006-08-22 15:03:13 +04:00
unknown
ad0f34e38e Bug#21757: mysql_client_test fails in testcase when reading master.log file
tests/mysql_client_test.c:
  Replace fopen with my_fopen and specify O_BINARY. Replace fclose with my_fclose.
2006-08-21 20:29:11 -04:00
unknown
686ca81307 Fix compile errors in VC++ 7.0 2006-08-21 16:21:48 +04:00
unknown
7a8f8733e3 Merge bk-internal:/home/bk/mysql-5.0-maint
into  shellback.(none):/home/msvensson/mysql/mysql-5.0-maint


tests/mysql_client_test.c:
  Auto merged
2006-08-21 14:09:38 +02:00
unknown
d36b0cdf49 Print lines from log file to see what's in them 2006-08-21 14:06:59 +02:00
unknown
d2fa8e3a8d Fix by Georgi Kodinov:
Bug #18744 Test 'join_outer' fails if "classic" configuration in 5.0
 - moved an InnoDB dependent test to the appropriate file


mysql-test/r/innodb_mysql.result:
  Bug #18744 Test 'join_outer' fails if "classic" configuration in 5.0
   - moved an InnoDB dependent test to the appropriate file
mysql-test/r/join_outer.result:
  Bug #18744 Test 'join_outer' fails if "classic" configuration in 5.0
   - moved an InnoDB dependent test to the appropriate file
mysql-test/t/innodb_mysql.test:
  Bug #18744 Test 'join_outer' fails if "classic" configuration in 5.0
   - moved an InnoDB dependent test to the appropriate file
mysql-test/t/join_outer.test:
  Bug #18744 Test 'join_outer' fails if "classic" configuration in 5.0
   - moved an InnoDB dependent test to the appropriate file
2006-08-21 14:20:03 +04:00
unknown
808ee3feb3 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0
into  hasky.mysql.fi:/home/jani/mysql-5.0_bug21537
2006-08-21 13:06:45 +03:00
unknown
7a11df8c93 Fixed bug#21475: Wrongly applied constant propagation leads to a false comparison.
A date can be represented as an int (like 20060101) and as a string (like
"2006.01.01"). When a DATE/TIME field is compared in one SELECT against both
representations the constant propagation mechanism leads to comparison
of DATE as a string and DATE as an int. In this example it compares 2006 and
20060101 integers. Obviously it fails comparison although they represents the
same date.


Now the Item_bool_func2::fix_length_and_dec() function sets the comparison
context for items being compared. I.e. if items compared as strings the
comparison context is STRING.
The constant propagation mechanism now doesn't mix items used in different
comparison contexts. The context check is done in the
Item_field::equal_fields_propagator() and in the change_cond_ref_to_const() 
functions.

Also the better fix for bug 21159 is introduced.


mysql-test/t/type_datetime.test:
  Added a test case for bug#21475: Wrongly applied constant propagation leads to a false comparison.
mysql-test/r/type_datetime.result:
  Added a test case for bug#21475: Wrongly applied constant propagation leads to a false comparison.
sql/sql_select.cc:
  Fixed bug#21475: Wrongly applied constant propagation leads to a false comparison.
  The constant propagation mechanism now doesn't mix items used in different
  comparison contexts. The check is done in the change_cond_ref_to_const() function.
sql/item_cmpfunc.cc:
  Fixed bug#21475: Wrongly applied constant propagation leads to a false comparison.
  Now the Item_bool_func2::fix_length_and_dec() function sets the comparison
  context for items being compared.
sql/item.h:
  Fixed bug#21475: Wrongly applied constant propagation leads to a false comparison.
  To the Item class a new field called cmp_context is added.
  It represents the comparison context of an item.
sql/item.cc:
  Fixed bug#21475: Wrongly applied constant propagation leads to a false comparison.
  The constant propagation mechanism now doesn't mix items used in different
  comparison contexts. The context check is done in the
  Item_field::equal_fields_propagator() function.
2006-08-21 00:23:57 +04:00
unknown
70b7378898 Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/cps/mysql/trees/mysql-5.0-virgin


sql/examples/ha_tina.cc:
  Auto merged
2006-08-18 16:48:32 +04:00
unknown
3468780e0c innodb r702
innodb r719


innobase/btr/btr0btr.c:
  innodb r702
innobase/buf/buf0buf.c:
  innodb r702
innobase/dict/dict0dict.c:
  innodb r702
innobase/fil/fil0fil.c:
  innodb r702
innobase/fsp/fsp0fsp.c:
  innodb r702
innobase/include/btr0cur.ic:
  innodb r719
innobase/include/buf0buf.ic:
  innodb r702
innobase/log/log0log.c:
  innodb r702
innobase/log/log0recv.c:
  innodb r702
innobase/os/os0file.c:
  innodb r702
innobase/row/row0mysql.c:
  innodb r702
innobase/row/row0sel.c:
  innodb r702
innobase/srv/srv0start.c:
  innodb r702
innobase/ut/ut0dbg.c:
  innodb r702
sql/ha_innodb.cc:
  innodb r702
2006-08-18 14:16:11 +02:00
unknown
5c8c2ab43b Merge zippy.cornsilk.net:/home/cmiller/work/mysql/merge/tmp_merge
into  zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0


BitKeeper/deleted/.del-mysql_client.result:
  Auto merged
BitKeeper/deleted/.del-mysql_client.test:
  Auto merged
client/mysql.cc:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/grant.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/grant.test:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
2006-08-17 10:55:57 -04:00
unknown
860c385346 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/merge/tmp_merge
into  zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0


client/mysql.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2006-08-17 10:53:12 -04:00
unknown
1cbebc6e18 ndb_condition_pushdown.result:
Corrected test case result after fix for bug#18165
view.result, view.test:
  Corrected test case for bug#21261


mysql-test/t/view.test:
  Corrected test case for bug#21261
mysql-test/r/view.result:
  Corrected test case for bug#21261
mysql-test/r/ndb_condition_pushdown.result:
  Corrected test case result after fix for bug#18165
2006-08-17 18:50:53 +04:00