Commit graph

9647 commits

Author SHA1 Message Date
unknown
96e5be8ce2 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mockturtle.local:/home/dlenev/src/mysql-5.0-bg20390-2


sql/sql_select.cc:
  Auto merged
2007-01-15 13:48:07 +03:00
unknown
408d775249 Manual merge.
mysql-test/r/sp.result:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_list.h:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-01-15 13:10:07 +03:00
unknown
810fc001d9 Fix for bug#20390 "SELECT FOR UPDATE does not release locks
of untouched rows in full table scans".

SELECT ... FOR UPDATE/LOCK IN SHARE MODE statements as well as
UPDATE/DELETE statements which were executed using full table
scan were not releasing locks on rows which didn't satisfy
WHERE condition.
This bug surfaced in 5.0 and affected NDB tables. (InnoDB tables
intentionally don't support such unlocking in default mode).

This problem occured because code implementing join didn't call
handler::unlock_row() for rows which didn't satisfy part of condition
attached to this particular table/level of nested loop. So we solve
the problem adding this call.
Note that we already had this call in place in 4.1 but it was lost
(actually not quite correctly placed) when we have introduced nested 
joins.

Also note that additional QA should be requested once this patch is
pushed as interaction between handler::unlock_row() and many recent
MySQL features such as subqueries, unions, views is not tested enough.


mysql-test/r/ndb_lock.result:
  Enabled back part of the test that covers bug #20390 "SELECT FOR
  UPDATE does not release locks of untouched rows in full table scans".
  Adjusted test in such way that it now covers both execution paths
  in which we unlock non-matching rows inspected during table scan.
mysql-test/t/ndb_lock.test:
  Enabled back part of the test that covers bug #20390 "SELECT FOR
  UPDATE does not release locks of untouched rows in full table scans".
  Adjusted test in such way that it now covers both execution paths
  in which we unlock non-matching rows inspected during table scan.
sql/sql_select.cc:
  evaluate_join_record() should call handler::unlock_row() for records
  which don't satisfy condition which was pushed-down to this table/level
  of nested loop.
  We just put back the thing that we already have in 4.1 and which was lost
  when we have introduced nested joins.
2007-01-15 12:32:38 +03:00
unknown
fc681ea701 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime


sql/item_func.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
2007-01-12 21:59:17 +03:00
unknown
6ab5bdf311 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime


heap/hp_block.c:
  Auto merged
mysql-test/r/view.result:
  Auto merged
server-tools/instance-manager/listener.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_string.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
heap/hp_write.c:
  SCCS merged
2007-01-11 21:59:28 +03:00
unknown
7f9da471cd Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B25106-5.0-opt


sql/sql_base.cc:
  Auto merged
2007-01-11 19:13:04 +02:00
unknown
6c41a043a4 BUG#25106: A USING clause in combination with a VIEW results in column
aliases ignored
When a column reference to a column in JOIN USING is resolved and a new 
Item is created for this column the user defined name was lost.
This fix preserves the alias by setting the name of the new Item to the
original alias.


mysql-test/r/join.result:
  BUG#25106: A USING clause in combination with a VIEW results in column
             aliases ignored
   - test case
mysql-test/t/join.test:
  BUG#25106: A USING clause in combination with a VIEW results in column
             aliases ignored
   - test case
sql/sql_base.cc:
  BUG#25106: A USING clause in combination with a VIEW results in column
             aliases ignored
   - take the alias of the Item to be replaced and set it into the newly
     allocated Item.
2007-01-11 19:10:01 +02:00
unknown
ce3a76a4a8 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/d2/hf/mr10/my50-mr10


sql/mysqld.cc:
  Auto merged
2007-01-11 13:18:49 +04:00
unknown
6943153ead Merge olga.mysql.com:/home/igor/mysql-4.1-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt


sql/item.cc:
  Auto merged
mysql-test/r/order_by.result:
  Manual merge
mysql-test/t/order_by.test:
  Manual merge
2007-01-10 08:55:55 -08:00
unknown
380ad35c20 Merge mysql.com:/d2/hf/common/my50-common
into  mysql.com:/d2/hf/mr10/my50-mr10
2007-01-10 14:33:34 +04:00
unknown
6fc17dab1e Fixed bug #25427.
In the method Item_field::fix_fields we try to resolve the name of
the field against the names of the aliases that occur in the select
list. This is done by a call of the function find_item_in_list.
When this function finds several occurrences of the field name
it sends an error message to the error queue and returns 0.
Yet the code did not take into account that find_item_in_list
could return 0 and tried to dereference the returned value.


mysql-test/r/order_by.result:
  Added a test case for bug #25427.
mysql-test/t/order_by.test:
  Added a test case for bug #25427.
sql/item.cc:
  Fixed bug #25427.
  In the method Item_field::fix_fields we try to resolve the name of
  the field against the names of the aliases that occur in the select
  list. This is done by a call of the function find_item_in_list.
  When this function finds several occurrences of the field name 
  it sends an error message to the error queue and returns 0.
  Yet the code did not take into account that find_item_in_list
  could return 0 and tried to dereference the returned value.
2007-01-10 00:27:11 -08:00
unknown
b04652e289 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt
2007-01-09 17:31:14 -08:00
unknown
f094fe551a Fixed bug#16861: User defined variable can have a wrong value if a tmp table was
used.

The Item::save_in_field() function is called from fill_record() to fill the 
new row with data while execution of the CREATE TABLE ... SELECT statement.
Item::save_in_field() calls val_xxx() methods in order to get values.
val_xxx() methods do not take into account the result field. Due to this
Item_func_set_user_var::val_xxx() methods returns values from the original
table, not from the temporary one.

The save_in_field() member function is added to the Item_func_set_user_var
class. It detects whether the result field should be used and properly updates
the value of the user variable.


sql/item_func.cc:
  Bug#16861: User defined variable can have a wrong value if a tmp table was used.
  Added the save_in_field() member function to the Item_func_set_user_var class.
sql/item_func.h:
  Bug#16861: User defined variable can have a wrong value if a tmp table was used.
  Added the save_in_field() member function to the Item_func_set_user_var class.
mysql-test/r/user_var.result:
  Extended the test case for bug#18681: User defined variable can have a wrong value if
  a tmp table was used.
mysql-test/t/user_var.test:
  Extended the test case for bug#18681: User defined variable can have a wrong value if
  a tmp table was used.
2007-01-09 23:24:56 +03:00
unknown
15bb22c0a8 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt


sql/item_cmpfunc.cc:
  Auto merged
2007-01-09 12:07:13 -08:00
unknown
78dff026af Bug#14171: Wrong internal default value for a BINARY field.
A BINARY field is represented by the Field_string class. The space character
is used as the filler for unused characters in such a field. But a BINARY field 
should use \x00 instead.

Field_string:reset() now detects whether the current field is a BINARY one
and if so uses the \x00 character as a default value filler.


sql/field.h:
  Bug#14171: Wrong internal default value for a BINARY field.
  Field_string:reset() now detects whether the current field is a BINARY one
  and if so uses the \x00 character as a default value filler.
mysql-test/r/type_binary.result:
  Added a test case for the bug#14171: Wrong internal default value for a BINARY field.
mysql-test/t/type_binary.test:
  Added a test case for the bug#14171: Wrong internal default value for a BINARY field.
2007-01-09 22:35:30 +03:00
unknown
eca431f3f3 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug25027


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
2007-01-09 10:26:28 -08:00
unknown
470ea99c42 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24345


sql/sql_select.cc:
  Auto merged
2007-01-09 00:17:48 -08:00
unknown
42e31f7a45 Bug #15881: cast problems
The optimizer removes expressions from GROUP BY/DISTINCT
  if they happen to participate in a <expression> = <const>
  predicates of the WHERE clause (the idea being that if
  it's always equal to a constant it can't have multiple 
  values).
  However for predicates where the expression and the 
  constant item are of different result type this is not
  valid (e.g. a string column compared to 0).
  Fixed by additional check of the result types of the 
  expression and the constant and if they differ the 
  expression don't get removed from the group by list.


mysql-test/r/distinct.result:
  Bug #15881: cast problems
    - test case
mysql-test/t/distinct.test:
  Bug #15881: cast problems
    - test case
sql/sql_select.cc:
  Bug #15881: cast problems
    - can't use <expr>=<const> to remove GROUP BY/DISTINCT cols
      if they're not of the same type.
2007-01-05 14:02:50 +02:00
unknown
42010cde4a Fixed bug #24345.
This bug appeared after the patch for bug 21390 that had added some code
to handle outer joins with no matches after substitution of a const
table in an efficient way. That code as it is cannot be applied to the case
of nested outer join operations. Being applied to the queries with
nested outer joins the code can cause crashes or wrong result sets.
The fix blocks row substitution for const inner tables of an outer join
if the inner operand is not a single table.  


mysql-test/r/join_nested.result:
  Added a test case for bug #24345.
mysql-test/t/join_nested.test:
  Added a test case for bug #24345.
2007-01-03 12:16:03 -08:00
unknown
8e0eea0d33 Merge mysql.com:/d2/hf/common/my41-common
into  mysql.com:/d2/hf/opt/my41-opt
2007-01-03 11:17:00 +04:00
unknown
6a4fbf09be Merge mysql.com:/d2/hf/common/my50-common
into  mysql.com:/d2/hf/opt/my50-opt


myisam/mi_check.c:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
2007-01-03 11:13:01 +04:00
unknown
11e53d8b76 mysql_upgrade disabled in embedded server
mysql-test/t/mysql_upgrade.test:
  test disabled in embedded server
2007-01-03 03:33:26 +04:00
unknown
6de3acece2 Merge mysql.com:/d2/hf/common/my41-common
into  mysql.com:/d2/hf/common/my50-common


mysql-test/t/mysqladmin.test:
  Auto merged
sql/item_func.cc:
  Auto merged
libmysqld/lib_sql.cc:
  merging
mysql-test/t/distinct.test:
  merging
sql/sql_prepare.cc:
  SCCS merged
2007-01-02 17:50:55 +04:00
unknown
4a12418583 embedded-server related fixes
libmysqld/lib_sql.cc:
  error message moved to 'stmt'
mysql-test/t/distinct.test:
  temporary disabled in embedded server
mysql-test/t/mysqladmin.test:
  disabled in embedded server
sql/sql_prepare.cc:
  superfluous #ifndef removed
2007-01-02 17:46:20 +04:00
unknown
84d0cda44c Merge mysql.com:/d2/hf/clean/my50-clean
into  mysql.com:/d2/hf/common/my50-common


mysql-test/mysql-test-run.pl:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
2006-12-31 12:39:20 +04:00
unknown
62576974de Merge mysql.com:/d2/hf/clean/my41-clean
into  mysql.com:/d2/hf/common/my41-common


sql/item_func.cc:
  Auto merged
2006-12-31 12:37:42 +04:00
unknown
e9adafcdf6 Merge trift2.:/MySQL/M50/mysql-5.0
into  trift2.:/MySQL/M50/push-5.0


client/mysql_upgrade.c:
  Auto merged
2006-12-28 18:22:43 +01:00
unknown
655650f58c Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  poseidon.mysql.com:/home/tomas/mysql-5.0-ndb


ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.cpp:
  Auto merged
ndb/src/ndbapi/NdbTransaction.cpp:
  Auto merged
ndb/src/ndbapi/Ndbif.cpp:
  Auto merged
ndb/test/ndbapi/testBasic.cpp:
  Auto merged
ndb/test/ndbapi/testIndex.cpp:
  Auto merged
2006-12-27 19:36:41 +01:00
unknown
bf075d8259 lock_multi disabled
mysql-test/t/lock_multi.test:
  doesn't work in embedded server
2006-12-26 20:22:16 +04:00
unknown
f63d8c8d0c BUG#25048 - ERROR 126 : Incorrect key file for table '.XXXX.MYI'; try to
repair it

Multi-table delete that is optimized with QUICK_RANGE reports table
corruption.

DELETE statement must not use KEYREAD optimization, and sets
table->no_keyread to 1. This was ignored in QUICK_RANGE optimization.

With this fix QUICK_RANGE optimization honors table->no_keyread
value and does not enable KEYREAD when it is requested.


mysql-test/r/index_merge.result:
  Fixed a test case according to fix for bug#25048.
mysql-test/r/index_merge_ror.result:
  A test case for bug#25048.
mysql-test/t/index_merge_ror.test:
  A test case for bug#25048.
sql/opt_range.cc:
  Do not use key read when head->no_keyread is set.
2006-12-26 17:47:30 +04:00
unknown
16b596bf34 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  chilla.local:/home/mydev/mysql-5.0-axmrg


configure.in:
  Auto merged
2006-12-21 17:13:38 +01:00
unknown
4c737cf142 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B23578-5.0-opt
2006-12-21 11:50:01 +02:00
unknown
eff3409964 Merge trift2.:/MySQL/M50/push-5.0
into  trift2.:/MySQL/M50/clone-5.0
2006-12-20 11:17:31 +01:00
unknown
b8550ca15a Fix silly typos in the disabling of "im_daemon_life_cycle" (bug#24415). 2006-12-20 11:13:16 +01:00
unknown
c6e1e91b66 Merge mysqldev@production.mysql.com:/data0/mysqldev/my/build-200612151202-5.0.32/mysql-5.0-release
into  trift2.:/MySQL/M50/clone-5.0
2006-12-20 10:58:16 +01:00
unknown
14d05efc91 Disable test "im_deamon_life_cycle", Bug#24425, see note: [19 Dec 23:17] Trudy Pelzer 2006-12-20 10:54:41 +01:00
unknown
b38fd5c427 Merge dev:my/build-200612151202-5.0.32/mysql-5.0-release
into  kahlann.erinye.com:/home/df/mysql/build/mysql-5.0-release
2006-12-20 09:44:47 +01:00
unknown
6417ddd6d3 Merge siva.hindu.god:/usr/home/tim/m/bk/50-24200
into  siva.hindu.god:/usr/home/tim/m/bk/50-release
2006-12-19 17:43:56 -07:00
unknown
47b0a0b089 Added innodb_rollback_on_timeout option to restore the 4.1
InnoDB timeout behavior (Bug #24200)


mysql-test/t/innodb_mysql-master.opt:
  Set --innodb-lock-wait-timeout=2, since test for bug #24200 times out.
  
  This *could* cause random test failures if some long-running transaction concurrency is being tested.  However, such a test really should go in innodb-big or some other test file.
2006-12-19 16:57:51 -07:00
unknown
f8920dd59f Bug #24947: REPEAT function returns NULL when passed a field as the count parameter
Handling of large signed/unsigned values was not consistent, so some string functions could return bogus results.
The current fix is to simply patch up the val_str() methods for those string items.
It would be good clean this code up in general, to make similar problems much harder to make.  This is left as an exercise for the reader.


mysql-test/r/func_str.result:
  Update test results for bug #24947
mysql-test/t/func_str.test:
  Add test case for bug #24947
sql/item_strfunc.cc:
  Adjust some string function Items' val_str() methods to handle large signed/unsigned arguments properly
2006-12-19 15:54:12 -07:00
unknown
cc21a4822d Merge kahlann.erinye.com:/home/df/mysql/build/mysql-4.1-build-work
into  kahlann.erinye.com:/home/df/mysql/build/mysql-5.0-build-work


mysql-test/t/grant_cache.test:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/query_cache_notembedded.test:
  Auto merged
mysql-test/t/rpl_rotate_logs.test:
  Auto merged
mysql-test/t/rpl000015.test:
  SCCS merged
mysql-test/t/rpl000017.test:
  SCCS merged
2006-12-19 15:31:10 +01:00
unknown
2eeeb9b4d3 remove hard-coded socket paths from some tests
mysql-test/t/grant_cache.test:
  replace hard-coded socket paths with variable containing the appropriate path
mysql-test/t/myisam.test:
  replace hard-coded socket paths with variable containing the appropriate path
mysql-test/t/query_cache_notembedded.test:
  replace hard-coded socket paths with variable containing the appropriate path
mysql-test/t/rpl000015.test:
  replace hard-coded socket paths with variable containing the appropriate path
mysql-test/t/rpl000017.test:
  replace hard-coded socket paths with variable containing the appropriate path
mysql-test/t/rpl_rotate_logs.test:
  replace hard-coded socket paths with variable containing the appropriate path
2006-12-19 15:10:15 +01:00
unknown
ce10e6ca13 Bug #23578: Corruption prevents Optimize table from working properly with a
spatial index
 While executing OPTIMIZE TABLE on MyISAM tables the server re-creates the
 index file(s) in order to sort them physically by the key. This cannot be 
 done for R-tree indexes as it makes no sense.
 The server was not checking the type of the index and was accessing an 
 R-tree index as if it was a B-tree.
 Fixed by preventing sorting the index file if it contains an R-tree index.  
 


myisam/mi_check.c:
  Bug #23578: Corruption prevents Optimize table from working properly with a
  spatial index
   - disable sorting the index file if it contains an R-tree index.
mysql-test/r/gis-rtree.result:
  Bug #23578: Corruption prevents Optimize table from working properly with a
  spatial index
   - test case
mysql-test/t/gis-rtree.test:
  Bug #23578: Corruption prevents Optimize table from working properly with a
  spatial index
   - test case
2006-12-19 15:04:26 +02:00
unknown
b66ab7f80b Fix for BUG#24293: '\Z' token is not handled correctly in views.
If SELECT-part of CREATE VIEW statement contains '\Z',
it is not handled correctly.

The problem was in String::print().
Symbol with code 032 (26) is replaced with '\z',
which is not supported by the lexer.

The fix is to replace the symbol with '\Z'.


mysql-test/r/view.result:
  Update result file.
mysql-test/t/view.test:
  Add test case for BUG#24293.
sql/sql_string.cc:
  We should replace 032 with \Z, since lexer does not understand \z.
2006-12-19 15:32:02 +03:00
unknown
d6bc366f44 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  chilla.local:/home/mydev/mysql-5.0-axmrg


configure.in:
  Auto merged
sql/sql_class.h:
  Auto merged
2006-12-19 12:41:39 +01:00
unknown
9166c711c2 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  chilla.local:/home/mydev/mysql-4.1-axmrg
2006-12-19 10:40:53 +01:00
unknown
acf0636e2e Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove
the UDF
When deleting a user defined function MySQL must remove it from both the
in-memory hash table and the mysql.proc system table.
Finding (and removal therefore) from the internal hash table is case 
insensitive (or whatever the default charset is), whereas finding and 
removal from the system table is case sensitive.
As a result if you supply a function name that is not in the same character
case to DROP FUNCTION the server will remove the function only from the
in-memory hash table and will keep the row in mysql.proc system table.
This will cause inconsistency between the two structures (that is fixed
only by restarting the server).
Fixed by using the name in the precise case (from the in-memory hash table)
to delete the row in the mysql.proc system table. 


mysql-test/r/udf.result:
  Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove
              the UDF
   - test case
mysql-test/t/udf.test:
  Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove
              the UDF
   - test case
sql/sql_udf.cc:
  Bug #15439: UDF name case handling forces DELETE FROM mysql.func to remove
              the UDF
   - use the exact function name in deleting from mysql.proc.
2006-12-15 11:38:30 +02:00
unknown
cbd1bd9078 Fixed bug #25027.
Blocked evaluation of constant objects of the classes
Item_func_is_null and Item_is_not_null_test at the
prepare phase in the cases when the objects used subqueries. 


mysql-test/r/ps.result:
  Extended test case for bug #25027.
mysql-test/t/ps.test:
  Extended test case for bug #25027.
sql/sql_lex.cc:
  Returned back the assertion in st_select_lex_unit::set_limit,
  removed by the previous commit for this bug.
2006-12-13 21:08:25 -08:00
unknown
b9d2627ca1 Merge mysql.com:/home/svoj/devel/mysql/BUG23404/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG23404/mysql-5.0-engines


mysql-test/r/alter_table.result:
  Auto merged
mysql-test/t/alter_table.test:
  Auto merged
sql/sql_parse.cc:
  SCCS merged
2006-12-13 16:29:33 +04:00
unknown
a4ad07b7ea Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG23404/mysql-4.1-engines


mysql-test/r/alter_table.result:
  SCCS merged
mysql-test/t/alter_table.test:
  SCCS merged
2006-12-13 15:53:37 +04:00