Commit graph

350 commits

Author SHA1 Message Date
unknown
d6df18dd33 Merge kaamos.(none):/data/src/mysql-5.1
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


client/mysql.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
configure.in:
  Auto merged
include/my_global.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/ndb/src/kernel/blocks/backup/Backup.hpp:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/func_time.result:
  Manual merge.
mysql-test/r/view.result:
  Manual merge.
mysql-test/t/view.test:
  Manual merge.
scripts/mysql_config.sh:
  Manual merge.
sql-common/client.c:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
2008-03-12 11:19:46 +03:00
unknown
78d12b299e Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/32942/my51-32942


sql/sql_select.cc:
  Auto merged
mysql-test/r/select.result:
  merging
mysql-test/t/select.test:
  merging
2008-02-18 19:08:35 +04:00
unknown
16f69a3d54 Merge mysql.com:/home/hf/work/32942/my50-32942
into  mysql.com:/home/hf/work/32942/my51-32942


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
2008-02-18 16:07:47 +04:00
unknown
d6be1a9b95 Bug #32942 now() - interval '7200' second NOT pre-calculated, causing "full table scan"
Problem is not about intervals and doesn't actually cause 'full table scan'.
We have an optimization for DISTINCT when we have
'DISTINCT field_from_first_join_table' we don't need to read all the
rows from the JOIN-ed table if we found one conforming row.
It stopped working in 5.0 as we return NESTED_LOOP_OK if we came upon
that case in the evaluate_join_record() and that doesn't break the
recordreading loop in sub_select().

Fixed by returning NESTED_LOOP_NO_MORE_ROWS in this case.


mysql-test/r/select.result:
  Bug #32942 now() - interval '7200' second is NOT pre-calculated, causing "full table scan".
  
  test result
mysql-test/t/select.test:
  Bug #32942 now() - interval '7200' second is NOT pre-calculated, causing "full table scan"
  
  test case
sql/sql_select.cc:
  Bug #32942 now() - interval '7200' second NOT pre-calculated, causing "full table scan"
  
  return NESTED_LOOP_NO_MORE_ROWS when we don't need to read rows from
  this table anymore
2008-02-17 15:48:17 +04:00
unknown
22e2762640 Merge host.loc:/home/uchum/work/5.0-opt-gca
into  host.loc:/home/uchum/work/5.1-opt-gca


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
2008-02-13 19:37:05 +04:00
unknown
247efb9cf0 Fixed bug#33764: Wrong result with IN(), CONCAT() and implicit
type conversion.

Instead of copying of whole character string from a temporary
buffer, the server copied a short-living pointer to that string
into a long-living structure. That has been fixed.


mysql-test/r/select.result:
  Added test case for bug#33764.
mysql-test/t/select.test:
  Added test case for bug#33764.
sql/item_cmpfunc.cc:
  Fixed bug#33764.
  Copying of a pointer has been replaced with an optional copying of
  a whole array to a newly allocated memory space in case of a
  functional source item.
2008-02-13 19:32:19 +04:00
unknown
c1d0dd94bb Fix for Bug#32538: View definition picks up character set,
but not collation.

The problem here was that text literals in a view were always
dumped with character set introducer. That lead to loosing
collation information.

The fix is to dump character set introducer only if it was
in the original query. That is now possible because there 
is no problem any more of loss of character set of string
literals in views -- after WL#4052 the view is dumped 
in the original character set.


mysql-test/r/case.result:
  Update result file.
mysql-test/r/compress.result:
  Update result file.
mysql-test/r/ctype_collate.result:
  Update result file.
mysql-test/r/date_formats.result:
  Update result file.
mysql-test/r/ddl_i18n_koi8r.result:
  Update result file.
mysql-test/r/ddl_i18n_utf8.result:
  Update result file.
mysql-test/r/fulltext.result:
  Update result file.
mysql-test/r/func_crypt.result:
  Update result file.
mysql-test/r/func_encrypt.result:
  Update result file.
mysql-test/r/func_if.result:
  Update result file.
mysql-test/r/func_in.result:
  Update result file.
mysql-test/r/func_like.result:
  Update result file.
mysql-test/r/func_regexp.result:
  Update result file.
mysql-test/r/func_set.result:
  Update result file.
mysql-test/r/func_str.result:
  Update result file.
mysql-test/r/func_time.result:
  Update result file.
mysql-test/r/gis.result:
  Update result file.
mysql-test/r/group_min_max.result:
  Update result file.
mysql-test/r/mysqldump.result:
  Update result file.
mysql-test/r/negation_elimination.result:
  Update result file.
mysql-test/r/null.result:
  Update result file.
mysql-test/r/select.result:
  Update result file.
mysql-test/r/show_check.result:
  Update result file.
mysql-test/r/sp-code.result:
  Update result file.
mysql-test/r/ssl.result:
  Update result file.
mysql-test/r/ssl_compress.result:
  Update result file.
mysql-test/r/subselect.result:
  Update result file.
mysql-test/r/temp_table.result:
  Update result file.
mysql-test/r/type_blob.result:
  Update result file.
mysql-test/r/view.result:
  Update result file.
mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
  Update result file.
mysql-test/suite/rpl/r/rpl_get_lock.result:
  Update result file.
mysql-test/suite/rpl/r/rpl_master_pos_wait.result:
  Update result file.
mysql-test/t/view.test:
  Add a test case for Bug#32538.
sql/item.cc:
  Do not dump character set introducer if it was not specified
  explicitly in the original query.
sql/item.h:
  Add 'cs_specified' property to Item_string.
sql/sql_yacc.yy:
  Set Item_string::cs_specified property to TRUE
  when character set introducer is explicitly specified.
2008-02-12 22:09:16 +03:00
unknown
e316f813d9 Merge gleb.loc:/work/bk/PA/5.0-opt-32335
into  gleb.loc:/work/bk/5.1-opt


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/item_cmpfunc.cc:
  Merge with 5.0-opt.
2007-11-18 16:54:47 +04:00
unknown
99054db64c Fixed bug #32335.
Comparison of a BIGINT NOT NULL column with a constant arithmetic
expression that evaluates to NULL caused error 1048: "Column '...'
cannot be null".

Made convert_constant_item() check if the constant expression is NULL
before attempting to store it in a field. Attempts to store NULL in a
NOT NULL field caused query errors.


sql/item_cmpfunc.cc:
  Fixed bug #32335.
  1. Made convert_constant_item() check if the constant expression is NULL
     before attempting to store it in a field. Attempts to store NULL in
     a NOT NULL field caused query errors.
  
  2. Also minor bug has been fixed: the thd->count_cuted_fields value
     was not restored in case of successful conversion.
mysql-test/t/select.test:
  Added test case for bug #32335.
mysql-test/r/select.result:
  Added test case for bug #32335.
2007-11-18 00:02:55 +04:00
unknown
711cf7503d Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


BitKeeper/etc/ignore:
  auto-union
mysql-test/r/events_bugs.result:
  Auto merged
mysql-test/r/partition.result:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/select.result:
  manual merge
mysql-test/t/select.test:
  manual merge
2007-11-14 17:30:16 +04:00
unknown
bed60e0175 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt


mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
mysql-test/r/select.result:
  manual merge
mysql-test/t/select.test:
  manual merge
2007-11-14 17:26:22 +04:00
unknown
eae5346872 Merge polly.(none):/home/kaa/src/opt/bug30666/my51-bug29131
into  polly.(none):/home/kaa/src/opt/mysql-5.1-opt


sql/sql_select.cc:
  Auto merged
mysql-test/r/select.result:
  Manual merge.
mysql-test/t/select.test:
  Manual merge.
2007-11-12 12:35:42 +03:00
unknown
26ebe887c4 Merge polly.(none):/home/kaa/src/opt/bug30666/my50-bug29131
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt


sql/sql_select.cc:
  Auto merged
mysql-test/r/select.result:
  Manual merge.
mysql-test/t/select.test:
  Manual merge.
2007-11-12 12:29:20 +03:00
unknown
84fbbf4d7d Merge polly.(none):/home/kaa/src/opt/bug30666/my50-bug29131
into  polly.(none):/home/kaa/src/opt/bug30666/my51-bug29131


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-11-12 11:26:31 +03:00
unknown
a72ec638ff Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/misc/mysql/31800/51-31800


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
2007-11-10 13:36:40 +01:00
unknown
6b00e6eb2c Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/scratch/tnurnberg/31800/50-31800


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
2007-11-10 13:35:35 +01:00
unknown
91ceabf3b4 Merge mysql.com:/misc/mysql/31800/50-31800
into  mysql.com:/misc/mysql/31800/51-31800


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
2007-11-10 13:34:12 +01:00
unknown
ac3ef6c759 Bug#31800: Date comparison fails with timezone and slashes for greater than comparison
BETWEEN was more lenient with regard to what it accepted as a DATE/DATETIME
in comparisons than greater-than and less-than were. ChangeSet makes < >
comparisons similarly robust with regard to trailing garbage (" GMT-1")
and "missing" leading zeros. Now all three comparators behave similarly
in that they throw a warning for "junk" at the end of the data, but then
proceed anyway if possible. Before < > fell back on a string- (rather than
date-) comparison when a warning-condition was raised in the string-to-date
conversion. Now the fallback only happens on actual errors, while warning-
conditions still result in a warning being to delivered to the client.


mysql-test/r/select.result:
  Show that we compare DATE/DATETIME-like strings as date(time)s
  now, rather than as bin-strings.
  Adjust older result as "2005-09-3a" is now correctly seen as
  "2005-09-3" + trailing garbage, rather than as "2005-09-30".
mysql-test/t/select.test:
  Show that we compare DATE/DATETIME-like strings as date(time)s
  now, rather than as bin-strings.
sql-common/my_time.c:
  correct/clarify date-related comments, particulary for check_date().
  doxygenize comment while at it.
sql/item_cmpfunc.cc:
  get_date_from_str() no longer signals an error when all we had
  was a warning-condition -- and one we already gave the user a
  warning for at that. Preamble doxygenized.
2007-11-10 13:33:42 +01:00
unknown
5a98d8aabf Merge polly.(none):/home/kaa/src/opt/bug32103/my51-bug26215
into  polly.(none):/home/kaa/src/opt/mysql-5.1-opt


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
2007-11-08 12:10:36 +03:00
unknown
0075aa4960 Merge polly.(none):/home/kaa/src/opt/bug32103/my50-bug26215
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
2007-11-08 12:06:14 +03:00
unknown
fcddc280f1 Merge polly.(none):/home/kaa/src/opt/bug32103/my50-bug26215
into  polly.(none):/home/kaa/src/opt/bug32103/my51-bug26215


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/item.h:
  Auto merged
2007-11-08 11:50:26 +03:00
unknown
4713575c77 Merge polly.(none):/home/kaa/src/opt/bug32103/my41-bug26215
into  polly.(none):/home/kaa/src/opt/bug32103/my50-bug26215


mysql-test/t/select.test:
  Auto merged
mysql-test/r/select.result:
  Manual merge.
sql/item.h:
  Manual merge.
2007-11-08 11:46:58 +03:00
unknown
0a7a55d175 Fix for bug #32103: optimizer crash when join on int and mediumint with
variable in where clause.

Problem: the new_item() method of Item_uint used an incorrect
constructor. "new Item_uint(name, max_length)" calls
Item_uint::Item_uint(const char *str_arg, uint length) which assumes the
first argument to be the string representation of the value, not the
item's name. This could result in either a server crash or incorrect
results depending on usage scenarios.

Fixed by using the correct constructor in new_item():
Item_uint::Item_uint(const char *str_arg, longlong i, uint length).


mysql-test/r/select.result:
  Added a test case for bug #32103.
mysql-test/t/select.test:
  Added a test case for bug #32103.
sql/item.h:
  Use the correct constructor for Item_uint in Item_uint::new_item().
2007-11-07 18:45:04 +03:00
unknown
f668665955 Fix for bug #30666: Incorrect order when using range conditions on 2
tables or more

The problem was that the optimizer used the join buffer in cases when
the result set is ordered by filesort. This resulted in the ORDER BY
clause being ignored, and the records being returned in the order
determined by the order of matching records in the last table in join.

Fixed by relaxing the condition in make_join_readinfo() to take
filesort-ordered result sets into account, not only index-ordered ones.


mysql-test/r/select.result:
  Added a test case for bug #30666.
mysql-test/t/select.test:
  Added a test case for bug #30666.
sql/sql_select.cc:
  Relaxed the condition to determine when the join buffer usage must be
  disabled. The condition is now true for cases when the result set is
  ordered by filesort, that is when 'join->order &&
  !join->skip_sort_order' is true.
2007-11-07 14:00:45 +03:00
unknown
f139033063 Merge lambda.weblab:/home/malff/TREE/mysql-5.1-base
into  lambda.weblab:/home/malff/TREE/mysql-5.1-rt-merge


mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
2007-10-29 08:07:27 -06:00
unknown
0e076d4bb9 Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.1-opt


mysql-test/r/select.result:
  Auto merged
mysql-test/r/type_decimal.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
mysql-test/t/type_decimal.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/share/errmsg.txt:
  Merge with 5.0-opt
2007-10-26 18:05:46 +05:00
unknown
04ff9d4da0 Fixed bug #27695: View should not be allowed to have empty or
all space column names.

The parser has been modified to check VIEW column names
with the check_column_name function and to report an error
on empty and all space column names (same as for TABLE
column names).


sql/sql_yacc.yy:
  Fixed bug #27695.
  The parser has been modified to check VIEW column aliases
  with the check_column_name function and to report an error
  on empty columns and all space columns (same as for TABLE
  column names).
mysql-test/t/select.test:
  Updated test case for bug #27695.
mysql-test/r/select.result:
  Updated test case for bug #27695.
2007-10-25 10:32:52 +05:00
unknown
9aa4317066 Merge station.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  station.:/mnt/raid/alik/MySQL/devel/5.1-rt


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/sql_table.cc:
  Auto merged
2007-10-24 11:43:16 +04:00
unknown
6044965c4f Patch for BUG#30736: Row Size Too Large Error Creating a Table and
Inserting Data.

The problem was that under some circumstances Field class was not
properly initialized before calling create_length_to_internal_length()
function, which led to assert failure.

The fix is to do the proper initialization.

The user-visible problem was that under some circumstances
CREATE TABLE ... SELECT statement crashed the server or led
to wrong error message (wrong results).


mysql-test/r/select.result:
  Update result file.
mysql-test/t/select.test:
  Add a test case for BUG#30736: Row Size Too Large Error
  Creating a Table and Inserting Data.
sql/sql_table.cc:
  Move sql_field->decimals initialization before
  sql_field->create_length_to_internal_length() call.
2007-10-23 18:03:51 +04:00
unknown
10cde5e4b1 Bug #31094: Forcing index-based sort doesn't work anymore if joins are done
A rule was introduced by the 5.1 part of the fix for bug 27531 to 
prefer filesort over indexed ORDER BY when accessing all of the rows of a 
table (because it's faster). This new rule was not accounting for the 
presence of a LIMIT clause.
Fixed the condition for this rule so it will prefer filesort over 
indexed ORDER BY only if no LIMIT.


mysql-test/r/compress.result:
  Bug #31094: LIMIT is not considered a full index scan
mysql-test/r/join.result:
  Bug #31094: test case
mysql-test/r/select.result:
  Bug #31094: LIMIT is not considered a full index scan
mysql-test/r/ssl.result:
  Bug #31094: LIMIT is not considered a full index scan
mysql-test/r/ssl_compress.result:
  Bug #31094: LIMIT is not considered a full index scan
mysql-test/t/join.test:
  Bug #31094: test case
sql/sql_select.cc:
  Bug #31094: prefer filesort over indexed ORDER BY only if no LIMIT
2007-10-05 17:28:34 +03:00
unknown
ff4a94b779 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30639-5.1-opt


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/sql_lex.cc:
  Auto merged
2007-09-19 18:02:59 +03:00
unknown
717dba2422 Bug #30639: limit offset,rowcount wraps when rowcount >= 2^32 in windows
The parser uses ulonglong to store the LIMIT number. This number
 then is stored into a variable of type ha_rows. ha_rows is either
 4 or 8 byte depending on the BIG_TABLES define from config.h
 So an overflow may occur (and LIMIT becomes zero) while storing an
 ulonglong value in ha_rows.
 Fixed by :
  1. Using the maximum possible value for ha_rows on overflow
  2. Defining BIG_TABLES for the windows builds (to match the others) 


include/config-win.h:
  Bug #30639: turn on BIG_TABLES for windows
mysql-test/r/select.result:
  Bug #30639: test case
mysql-test/t/select.test:
  Bug #30639: test case
sql/sql_lex.cc:
  Bug #30639: Use the maximum possible number on overflow 
   of LIMIT. This is valid because there won't be more rows
   anyway.
2007-09-19 17:47:52 +03:00
unknown
1d97c7484b Merge devsrv-b.mysql.com:/data0/gshchepa/mysql-5.0-opt
into  devsrv-b.mysql.com:/data0/gshchepa/mysql-5.1-opt


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/share/errmsg.txt:
  Merge with 5.0-opt.
2007-09-14 10:37:42 +02:00
unknown
037a0f7677 Fixed bug #27695.
Declaring an all space column name in the SELECT FROM DUAL or in a view
leads to misleading warning message:
"Leading spaces are removed from name ' '".

The Item::set_name method has been modified to raise warnings like
"Name ' ' has become ''" in case of the truncation of an all
space identifier to an empty string identifier instead of the
"Leading spaces are removed from name ' '" warning message.


sql/item.cc:
  Fixed bug #27695.
  The Item::set_name method has been modified to raise warnings like
  "Name ' ' has become ''" in case of the truncation of an all
  space identifier to an empty string identifier instead of the
  "Leading spaces are removed from name ' '" warning message.
sql/share/errmsg.txt:
  Fixed bug #27695.
mysql-test/t/select.test:
  Added test case for bug #27695.
mysql-test/r/select.result:
  Added test case for bug #27695.
2007-09-13 18:41:50 +05:00
unknown
0d9046ecaf Post-merge fix. 2007-08-16 19:27:44 -07:00
unknown
59a1154675 Merge olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug30396
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.1-opt-bug30396


libmysql/libmysql.c:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
tests/mysql_client_test.c:
  Manual merge
2007-08-16 17:22:50 -07:00
unknown
a8f8e5483e Fixed bug #30396.
The bug caused memory corruption for some queries with top OR level
in the WHERE condition if they contained equality predicates and 
other sargable predicates in disjunctive parts of the condition.

The corruption happened because the upper bound of the memory
allocated for KEY_FIELD and SARGABLE_PARAM internal structures
containing info about potential lookup keys was calculated incorrectly
in some cases. In particular it was calculated incorrectly when the
WHERE condition was an OR formula with disjuncts being AND formulas
including equalities and other sargable predicates.


mysql-test/r/select.result:
  Added a test case for bug #30396.
mysql-test/t/select.test:
  Added a test case for bug #30396.
sql/item_cmpfunc.h:
  Removed max_members from the COND_EQUAL class as not useful anymore.
sql/sql_base.cc:
  Added the max_equal_elems field to the st_select_lex structure.
sql/sql_lex.cc:
  Added the max_equal_elems field to the st_select_lex structure.
sql/sql_lex.h:
  Added the max_equal_elems field to the st_select_lex structure.
  The field contains the maximal number of elements in multiple equalities
  built for the query conditions.
sql/sql_select.cc:
  Fixed bug #30396.
  The bug caused memory corruption for some queries with top OR level
  in the WHERE condition if they contained equality predicates and 
  other sargable predicates in disjunctive parts of the condition.
  
  The corruption happened because the upper bound of the memory
  allocated for KEY_FIELD and SARGABLE_PARAM internal structures
  containing info about potential lookup keys was calculated incorrectly
  in some cases. In particular it was calculated incorrectly when the
  WHERE condition was an OR formula with disjuncts being AND formulas
  including equalities and other sargable predicates.
   
  The max_equal_elems field to the st_select_lex structure is used now
  to calculate the above mentioned upper bound. The field contains the
  maximal number of elements in multiple equalities built for the query
  conditions.
2007-08-15 10:24:18 -07:00
unknown
bba712a6c8 Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.1-opt


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/unireg.h:
  Auto merged
sql/share/errmsg.txt:
  Merge with 5.0-opt.
2007-08-03 02:15:21 +05:00
unknown
a53510f0be Fixed bug #27352.
The SELECT query with more than 31 nested dependent SELECT queries returned
wrong result.

New error message has been added: ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT.
It will be reported as: "Too high level of nesting for select".


sql/sql_parse.cc:
  Fixed bug #27352.
  The Item_sum::register_sum_func method has been modified to return
  TRUE on exceeding of allowed level of SELECT nesting and to report
  corresponding error message.
sql/unireg.h:
  Fixed bug #27352.
  Constant definition has been added: maximal allowed level of SELECT nesting.
mysql-test/t/select.test:
  Updated test case for bug #27352.
mysql-test/r/select.result:
  Updated test case for bug #27352.
sql/share/errmsg.txt:
  Fixed bug #27352.
  New error message has been added: ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT.
2007-08-03 01:58:21 +05:00
unknown
ae398d995a Bug #29245: Bad Merge Caused Error Codes Conflict between 5.0/5.1
Fix some error messages so that all error codes are equivalent in 5.0 and 5.1


mysql-test/r/backup.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/events_bugs.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/events_trans.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/ndb_dd_basic.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/ndb_dd_ddl.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/ndb_gis.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/ndb_row_format.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_extraCol_innodb.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_extraCol_myisam.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_incident.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_ndb_extraCol.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_row_tabledefs_2myisam.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_row_tabledefs_3innodb.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_sp.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/select.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/show_check.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/sp.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/sp_gis.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/sp_trans.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/type_timestamp.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/warnings.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/xml.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/t/grant.test:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/t/partition_grant.test:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
sql/mysql_priv.h:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
sql/share/errmsg.txt:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
2007-06-26 13:15:43 +02:00
unknown
aff34a8c64 Bug #27531: 5.1 part of the fix
- Renamed "Using join cache" to "Using join buffer".
- "Using join buffer" is now printed on the last
  table that "reads" from the join buffer cache.


mysql-test/r/archive_gis.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/compress.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/ctype_utf8.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/derived.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/distinct.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/func_group.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/func_group_innodb.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/gis.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/greedy_optimizer.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/group_by.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/group_min_max.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/index_merge_myisam.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/information_schema.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/innodb_gis.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/innodb_mysql.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/join.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/join_nested.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/key_diff.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/myisam.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/ndb_condition_pushdown.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/ndb_gis.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/range.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/row.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/select.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/ssl.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/ssl_compress.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/subselect.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/subselect3.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/union.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
mysql-test/r/view.result:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
sql/sql_select.cc:
  Bug #27531: renamed "Using join cache" to "Using join buffer"
  and moved to the last table in the batch.
2007-05-29 15:58:18 +03:00
unknown
0c835da803 bug #27531: 5.1 part of the fix:
- added join cache indication in EXPLAIN (Extra column).
 - prefer filesort over full scan over 
   index for ORDER BY (because it's faster).
 - when switching from REF to RANGE because
   RANGE uses longer key turn off sort on
   the head table only as the resulting 
   RANGE access is a candidate for join cache
   and we don't want to disable it by sorting
   on the first table only. 


mysql-test/r/archive_gis.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/compress.result:
  bug #27531:
   - join cache in EXPLAIN. 
   - prefer filesort over full scan over index for ORDER BY.
mysql-test/r/ctype_utf8.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/derived.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/distinct.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/func_group.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/func_group_innodb.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/gis.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/greedy_optimizer.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/group_by.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/group_min_max.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/index_merge_myisam.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/information_schema.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/innodb_gis.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/innodb_mysql.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/join.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/join_nested.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/key_diff.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/myisam.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/ndb_condition_pushdown.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/ndb_gis.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/range.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/row.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/select.result:
  bug #27531:
   - join cache in EXPLAIN.
   - prefer filesort over full scan over index for ORDER BY.
mysql-test/r/ssl.result:
  bug #27531:
   - join cache in EXPLAIN.
   - prefer filesort over full scan over index for ORDER BY.
mysql-test/r/ssl_compress.result:
  bug #27531:
   - join cache in EXPLAIN.
   - prefer filesort over full scan over index for ORDER BY.
mysql-test/r/subselect.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/subselect3.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/union.result:
  bug #27531: join cache in EXPLAIN
mysql-test/r/view.result:
  bug #27531: join cache in EXPLAIN
sql/sql_select.cc:
  bug #27531:
   - join cache in EXPLAIN.
   - prefer filesort over full scan over
     index for ORDER BY.
   - disable sorting on the first table only
     when switching from REF to RANGE.
2007-05-04 18:06:06 +03:00
unknown
91d3299ce6 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.1-opt


mysql-test/r/distinct.result:
  Auto merged
mysql-test/r/row.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/strict.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
mysql-test/t/strict.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Manual merge
2007-04-11 15:12:49 -07:00
unknown
8e72b760aa Bug #19372:
Added a test case.
The problem was fixed by the fix for bug #17379.
The problem was that because of some conditions 
the optimizer always preferred range or full index
scan access methods to lookup access methods even
when the latter were much cheaper.


mysql-test/r/select.result:
  Bug #19372: test case.
  The problem was fixed by the patch for bug #17379
mysql-test/t/select.test:
  Bug #19372: test case.
  The problem was fixed by the patch for bug #17379
2007-04-10 19:08:08 +03:00
unknown
6e93d2939d WL3527: 5.0 part:
enabled the optional FOR JOIN to all the three
clauses : USE, FORCE and IGNORE


mysql-test/r/select.result:
  WL3527: 5.0 part: test cases
mysql-test/t/select.test:
  WL3527: 5.0 part: test cases
2007-03-26 16:52:52 +03:00
unknown
f3a731cadd Merge magare.gmz:/home/kgeorge/mysql/autopush/B26794-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B26794-merge-5.1-opt


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/r/alter_table.result:
  merged 5.0-opt -> 5.1-opt
mysql-test/r/gis-rtree.result:
  merged 5.0-opt -> 5.1-opt
mysql-test/r/order_by.result:
  merged 5.0-opt -> 5.1-opt
mysql-test/r/subselect.result:
  merged 5.0-opt -> 5.1-opt
mysql-test/t/alter_table.test:
  merged 5.0-opt -> 5.1-opt
mysql-test/t/order_by.test:
  merged 5.0-opt -> 5.1-opt
mysql-test/t/subselect.test:
  merged 5.0-opt -> 5.1-opt
2007-03-14 17:04:45 +02: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
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
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