Commit graph

10111 commits

Author SHA1 Message Date
unknown
e52288b5bf merge fixies BUG#10418 4.1 -> 5.0 2006-05-12 12:31:22 +02:00
unknown
98912fb95c Merge mysql.com:/home/mysql-4.1-10418
into  mysql.com:/home/mysql-5.0-10418


mysql-test/t/outfile.test:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
mysql-test/r/func_str.result:
  expect NULL rather than error if file given to load_file() doesn't exist
mysql-test/r/outfile.result:
  expect NULL rather than error if file given to load_file() doesn't exist
mysql-test/t/func_str.test:
  show that load_file() will return NULL rather than throw an error
  if file doesn't exist
2006-05-12 10:27:20 +02:00
unknown
5c6d923f30 Added a test case for bug #18940:in 5.0 the optimizer chose
a worse execution plan than in 4.1 for some queries.
It happened due the fact that at some conditions the 
optimizer always preferred range or full index scan access
methods to lookup access methods even when the latter were much
cheaper. 
The problem was not observed in 4.1 for the reported query
because the WHERE condition was not of a form that could
cause the problem.
Equality propagation introduced on 5.0 added an extra 
predicate and changed the WHERE condition. The new condition
provoked the optimizer to make a bad choice.

The problem was fixed by the patch for bug 17379.


mysql-test/r/select.result:
  Added a test case for bug #18940.
  The problem was fixed by the patch for bug 17379.
mysql-test/t/select.test:
  Added a test case for bug #18940.
  The problem was fixed by the patch for bug 17379.
2006-05-11 19:47:00 -07:00
unknown
ec83dd7c61 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/mysql-4.1-10418
2006-05-11 12:48:49 +02:00
unknown
e42692c0a9 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/mysql-5.0-19263
2006-05-11 01:18:15 +02:00
unknown
8db63fd52f Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  production.mysql.com:/usersnfs/rkalimullin/mysql-5.0
2006-05-10 18:52:31 +02:00
unknown
a8693be9d9 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  production.mysql.com:/usersnfs/rkalimullin/mysql-5.0
2006-05-10 17:09:15 +02:00
unknown
b02a34f2bf Merge cmiller@bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.(none):/home/cmiller/mysql-5.0__bug19564
2006-05-10 10:47:01 -04:00
unknown
3fa6432b09 BUG#17379 Wrong reuse of E(#rows(range)) as E(#rows(ref(const))):
Re-work best_access_path() and find_best() to reuse E(#rows(range access)) as
E(#rows(ref[_or_null](const) access) only when it is appropriate.
[This is the final cumulative patch]


mysql-test/r/select.result:
  BUG#17379: Testcase
mysql-test/r/subselect.result:
  BUG#17379: Updated test results
mysql-test/t/select.test:
  BUG#17379: Testcase
sql/opt_range.cc:
  BUG#17379: Wrong reuse of E(#rows(range)) as E(#rows(ref(const))):
  Make range optimizer together with TABLE::quick_* also return TABLE::quick_n_ranges
sql/sql_select.cc:
  BUG#17379: Wrong reuse of E(#rows(range)) as E(#rows(ref(const))):
  Re-work best_access_path() to reuse E(#rows(range access)) as
  E(#rows(ref[_or_null](const) access) only when it is appropriate.
sql/table.h:
  BUG#17379: Wrong reuse of E(#rows(range)) as E(#rows(ref(const))):
  Make range optimizer together with TABLE::quick_* also return TABLE::quick_n_ranges
2006-05-10 17:40:20 +04:00
unknown
af4d487a96 Merge mysql.com:/usr/home/ram/work/mysql-4.1
into  mysql.com:/usr/home/ram/work/mysql-5.0


sql/item_timefunc.cc:
  Auto merged
mysql-test/r/func_time.result:
  merging
mysql-test/t/func_time.test:
  merging
2006-05-10 18:27:42 +05:00
unknown
fe578d38a1 Merge cmiller@bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.(none):/home/cmiller/mysql-5.0__bug19564
2006-05-10 09:03:42 -04:00
unknown
3f73225669 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b18501


sql/item_timefunc.cc:
  Auto merged
2006-05-10 13:27:48 +05:00
unknown
588082712a Merge mysql.com:/home/kgeorge/mysql/5.0/clean
into  mysql.com:/home/kgeorge/mysql/5.0/B18068


sql/sql_select.cc:
  Auto merged
2006-05-10 09:38:40 +03:00
unknown
2e72ae3d81 Bug#19564: mysql displays NULL instead of space
Correct a bug (that I introduced, after using Oracle's database software for 
too many years) where the length of the database-sent data is incorrectly 
used to infer NULLness.


client/mysql.cc:
  No longer use the length of the data to infer whether it is NULL or not.
mysql-test/r/mysql.result:
  Add result and version marker, and correct previous result.
mysql-test/t/mysql.test:
  Add test and version marker
2006-05-09 22:35:51 -04:00
unknown
dac69dd4a2 Merge xiphis.org:/home/antony/work2/p1-bug10952.1
into  xiphis.org:/home/antony/work2/mysql-5.0-engines-merge
2006-05-09 15:12:32 -07:00
unknown
f61748b796 Merge acurtis@bk-internal:/home/bk/mysql-5.0-engines
into  xiphis.org:/home/antony/work2/p1-bug10952.1


sql/handler.h:
  Auto merged
sql/sql_table.cc:
  Auto merged
2006-05-09 13:34:31 -07:00
unknown
6116d0176b bug#10952
"alter table from MyISAM to MERGE lost data without errors and warnings"
  Add new handlerton flag which prevent user from altering table storage
  engine to storage engines which would lose data. Both 'blackhole' and 
  'merge' are marked with the new flag.
  Tests included.


mysql-test/r/blackhole.result:
  test for bug#10952
mysql-test/r/merge.result:
  test for bug#10952
mysql-test/t/blackhole.test:
  test for bug#10952
mysql-test/t/merge.test:
  test for bug#10952
sql/ha_blackhole.cc:
  Bug#10952
    shouldn't be able to alter a table into a blackhole
sql/ha_myisammrg.cc:
  Bug#10952
    shouldn't be able to alter a table into a merge
sql/handler.h:
  Bug#10952
    new handlerton flag
sql/sql_table.cc:
  Bug#10952
    If alter is changing engine, check if new engine allows creating table
    via ALTER statement.
2006-05-09 13:31:46 -07:00
unknown
baae7a97d9 BUG#18068: SELECT DISTINCT (with duplicates and covering index)
When converting DISTINCT to GROUP BY where the columns are from the covering
index and they are quoted twice in the SELECT list the optimizer is creating
improper processing sequence. This is because of the fact that the columns
of the covering index are not recognized as such and treated as non-index
columns.

Generally speaking duplicate columns can safely be removed from the GROUP
BY/DISTINCT list because this will not add or remove new rows in the
resulting set. Duplicates can be removed even if they are not consecutive
(as is the case for ORDER BY, where the duplicate columns can be removed
only if they are consecutive).

So we can safely transform "SELECT DISTINCT a,a FROM ... ORDER BY a" to
"SELECT a,a FROM ... GROUP BY a ORDER BY a" instead of 
"SELECT a,a FROM .. GROUP BY a,a ORDER BY a". We can even transform 
"SELECT DISTINCT a,b,a FROM ... ORDER BY a,b" to
"SELECT a,b,a FROM ... GROUP BY a,b ORDER BY a,b".

The fix to this bug consists of checking for duplicate columns in the SELECT
list when constructing the GROUP BY list in transforming DISTINCT to GROUP
BY and skipping the ones that are already in.


mysql-test/r/distinct.result:
  test case for the bug without loose index scan
mysql-test/r/group_min_max.result:
  test case for the bug
mysql-test/t/distinct.test:
  test case for the bug without loose index scan
mysql-test/t/group_min_max.test:
  test case for the bug
sql/sql_select.cc:
  duplicates check and removal
2006-05-09 18:13:01 +03:00
unknown
c7e2527c9a Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0


sql/item_func.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
2006-05-09 10:44:19 +02:00
unknown
0d3825a67e Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint


client/mysqltest.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
sql/mysql_priv.h:
  Auto merged
2006-05-09 08:26:25 +02:00
unknown
1a97d50ba8 Bug#19263: variables.test doesn't clean up after itself
save global server variables before fiddling with them and restore them later


BitKeeper/deleted/.del-variables-master.opt~8a6cb6459b54545:
  Delete: mysql-test/t/variables-master.opt
mysql-test/r/variables.result:
  save and restore globals
mysql-test/t/variables.test:
  save and restore globals
2006-05-08 14:59:29 +02:00
unknown
dd934da915 Bug#10418: LOAD_FILE does not behave like in manual if file does not exist
load_file() string-function should return NULL rather than throw an error if
the file doesn't exist, as per the manual.


mysql-test/t/outfile.test:
  expect NULL rather than error if file given to load_file() doesn't exist
mysql-test/t/func_str.test:
  show that load_file() will return NULL rather than throw an error
  if file doesn't exist
mysql-test/r/outfile.result:
  expect NULL rather than error if file given to load_file() doesn't exist
mysql-test/r/func_str.result:
  expect NULL rather than error if file given to load_file() doesn't exist
sql/item_strfunc.cc:
  load_file() should return NULL as per the docs if file not found,
  rather than throw an error
2006-05-08 04:37:58 +02:00
unknown
e4e67d587e Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into  rurik.mysql.com:/home/igor/mysql-4.1
2006-05-07 11:25:33 -07:00
unknown
a910a0bf69 Bug#19136: Crashing log-bin and uninitialized user variables in a derived table
recalculating results


mysql-test/r/rpl_user_variables.result:
  fixing results
2006-05-07 19:54:57 +03:00
unknown
048469eb79 Merge mysql.com:/usr_rh9/home/elkin.rh9/4.1
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/5.0-bug19136


sql/item_func.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/rpl_user_variables.result:
  manual merge use local
mysql-test/t/rpl_user_variables.test:
  manual merge use version 5.0's "show binlog events from 98"
2006-05-07 16:02:55 +03:00
unknown
ce6a2d32b3 Merge mysql.com:/usr_rh9/home/elkin.rh9/MySQL/BARE/4.1
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/FIXES/4.1-bug19136_unass_user_var


sql/item_func.cc:
  Auto merged
2006-05-07 11:43:27 +03:00
unknown
375749b8af Fixed bug #14927.
A query with a group by and having clauses could return a wrong
result set if the having condition contained a constant conjunct 
evaluated to FALSE.
It happened because the pushdown condition for table with
grouping columns lost its constant conjuncts.
Pushdown conditions are always built by the function make_cond_for_table
that ignores constant conjuncts. This is apparently not correct when
constant false conjuncts are present.



mysql-test/r/having.result:
  Added a test case for bug #14927.
mysql-test/t/having.test:
  Added a test case for bug #14927.
sql/sql_lex.cc:
  Fixed bug #14927.
  Initialized fields for having conditions in  st_select_lex::init_query().
sql/sql_lex.h:
  Fixed bug #14927.
  Added a field to restore having condititions for execution in SP and PS.
sql/sql_prepare.cc:
  Fixed bug #14927.
  Added code to restore havinf conditions for execution in SP and PS.
sql/sql_select.cc:
  Fixed bug #14927.
  Performed evaluation of constant expressions in having clauses.
  If the having condition contains a constant conjunct that is always false
  an empty result set is returned after the optimization phase.
  In this case the corresponding EXPLAIN command now returns 
  "Impossible HAVING" in the last column.
2006-05-06 23:48:13 -07:00
unknown
427bcfb440 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/psergey/mysql-4.1-bug16798
2006-05-06 22:15:27 +04:00
unknown
c27793a3da Merge mysql.com:/home/tomash/src/mysql_ab/tmp_merge
into  mysql.com:/home/tomash/src/mysql_ab/mysql-5.0-merge


mysql-test/r/func_misc.result:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
2006-05-06 19:45:24 +04:00
unknown
a60bd69777 Fix race condition in the test for bug#16501.
mysql-test/r/func_misc.result:
  Update the result.
2006-05-06 18:24:41 +04:00
unknown
447d5a0fac Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/psergey/mysql-4.1-bug16798
2006-05-06 13:48:20 +04:00
unknown
c13144722a BUG#16798: Inapplicable ref_or_null query plan and bad query result on random occasions
The bug was as follows: When merge_key_fields() encounters "t.key=X OR t.key=Y" it will 
try to join them into ref_or_null access via "t.key=X OR NULL". In order to make this 
inference it checks if Y<=>NULL, ignoring the fact that value of Y may be not yet known.

The fix is that the check if Y<=>NULL is made only if value of Y is known (i.e. it is a
constant).
TODO: When merging to 5.0, replace used_tables() with const_item() everywhere in merge_key_fields().


mysql-test/r/innodb_mysql.result:
  Testcase for BUG16798
mysql-test/t/innodb_mysql.test:
  Testcase for BUG16798
sql/sql_select.cc:
  BUG#16798: Inapplicable ref_or_null query plan and bad query result on random occasions 
  In merge_key_fields() don't call val->is_null() if the value of val is not known.
2006-05-06 13:15:00 +04:00
unknown
77b7a71dd4 Merge mysql.com:/home/tomash/src/mysql_ab/tmp_merge
into  mysql.com:/home/tomash/src/mysql_ab/mysql-5.0-merge


mysql-test/r/func_misc.result:
  Manual merge of the fix for bug#16501.
mysql-test/t/func_misc.test:
  Manual merge of the fix for bug#16501.
sql/item_func.cc:
  Manual merge of the fix for bug#16501.
sql/sql_acl.cc:
  For the fix of bug#16372, use local version, since the fix for 5.0 is
  different, and will go in separate ChangeSet.
2006-05-06 11:18:42 +04:00
unknown
0757e68d67 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0
into  hundin.mysql.fi:/home/jani/mysql-5.0merge_4_1_2nd
2006-05-05 14:25:33 +03:00
unknown
5f3bc525e3 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0
into  hundin.mysql.fi:/home/jani/mysql-5.0merge_4_1_2nd
2006-05-05 12:46:15 +03:00
unknown
e9399dc286 Merge mysql.com:/space/pekka/ndb/version/my50
into  mysql.com:/space/pekka/ndb/version/my50-work
2006-05-05 11:18:30 +02:00
unknown
4ab4631b06 Bug#19136: Crashing log-bin and uninitialized user variables in a derived table
The reason of the bug is in that `get_var_with_binlog' performs missed
assingment of
the variables as side-effect. Doing that it eventually calls
`free_underlaid_joins' to pass as an argument `thd->lex->select_lex' of the lex
which belongs to the user query, not 
to one which is emulated i.e SET @var1:=NULL.


`get_var_with_binlog' is refined to supply a temporary lex to sql_set_variables's stack.


mysql-test/r/rpl_user_variables.result:
  results changed
mysql-test/t/rpl_user_variables.test:
  a problematic query to be binlogged is added
sql/item_func.cc:
  BUG#19136: Crashing log-bin and uninitialized user variables
  
  The reason of the bug is in that how `get_var_with_binlog' performs missed
  assingment of the variables: `free_underlaid_joins' gets as an argument `thd->lex->select_lex'
  which belongs to the user query, not to one which is emulated i.e SET @var1:=NULL.
  
  `get_var_with_binlog' is refined to supply a temporary lex to sql_set_variables's stack.
2006-05-05 11:21:21 +03:00
unknown
5f7fec791e Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1
into  mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug16501
2006-05-05 11:35:38 +04:00
unknown
303cdacd09 ndb - bug#17421, changes NDB API pushdown LIKE arg to plain char
mysql-test/r/ndb_condition_pushdown.result:
  bug#17421, changes NDB API pushdown LIKE arg to plain char
mysql-test/t/ndb_condition_pushdown.test:
  bug#17421, changes NDB API pushdown LIKE arg to plain char
ndb/include/ndbapi/NdbOperation.hpp:
  bug#17421, changes NDB API pushdown LIKE arg to plain char
ndb/include/util/NdbSqlUtil.hpp:
  bug#17421, changes NDB API pushdown LIKE arg to plain char
ndb/src/common/util/NdbSqlUtil.cpp:
  bug#17421, changes NDB API pushdown LIKE arg to plain char
2006-05-05 00:53:34 +02:00
unknown
16022e635c Added more comments to the test cases. 2006-05-05 00:27:12 +03:00
unknown
5f173c302e Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0


mysql-test/r/date_formats.result:
  Auto merged
mysql-test/t/date_formats.test:
  Auto merged
sql/item_timefunc.cc:
  Merged from 4.1
2006-05-05 00:22:01 +03:00
unknown
d2ee7c6ea8 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2006-05-04 23:49:59 +03:00
unknown
afe4715242 Fixed wrong free in sql_view.cc
mysql-test-run now fails in case of warnings


mysql-test/lib/mtr_report.pl:
  Fail if find warnings
mysql-test/mysql-test-run.sh:
  Fail if find warnings
sql/sql_lex.cc:
  Initalize st_lex properly
sql/sql_view.cc:
  Fixed problem with unaligned memory (wrong free)
2006-05-04 22:19:31 +03:00
unknown
7c9f5a8d49 Fixed a test case that got broken during merge. 2006-05-04 21:21:22 +03:00
unknown
02dcc76e37 Fixed Bug#11324:
TIME_FORMAT using "%l:%i" returns 36:00 with 24:00:00 in TIME column


mysql-test/r/date_formats.result:
  Added test case for Bug#11324,
  "TIME_FORMAT using "%l:%i" returns 36:00 with 24:00:00 in TIME column"
mysql-test/t/date_formats.test:
  Added test case for Bug#11324,
  "TIME_FORMAT using "%l:%i" returns 36:00 with 24:00:00 in TIME column"
2006-05-04 20:19:37 +03:00
unknown
bcb61e6860 Fix for Bug#11326.
mysql-test/r/date_formats.result:
  Added test cases for Bug#11326
mysql-test/t/date_formats.test:
  Added test cases for Bug#11326
2006-05-04 19:31:10 +03:00
unknown
0c7aa68d2a Bug#18474 Unlistable directories yield no info from information_schema, part2
- Move "chmod" part of information_schema test to separate file


mysql-test/r/information_schema.result:
  Move "chmod" part of information_schema test to separate file
mysql-test/t/information_schema.test:
  Move "chmod" part of information_schema test to separate file
mysql-test/r/information_schema_chmod.result:
  Move "chmod" part of information_schema test to separate file
mysql-test/t/information_schema_chmod.test:
  Move "chmod" part of information_schema test to separate file
2006-05-04 17:47:25 +02:00
unknown
9da29acc31 Move "check_running_as_root" to after var directory has been created 2006-05-04 17:44:09 +02:00
unknown
f31cb5dd8e Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0


mysql-test/r/gis-rtree.result:
  Auto merged
mysql-test/r/ansi.result:
  Merged from 4.1
mysql-test/r/auto_increment.result:
  Merged from 4.1
mysql-test/r/mysqldump.result:
  Merged from 4.1
mysql-test/r/symlink.result:
  Merged from 4.1
mysql-test/t/auto_increment.test:
  Merged from 4.1
mysql-test/t/mysqldump.test:
  Merged from 4.1
sql/set_var.cc:
  Merged from 4.1
sql/sql_show.cc:
  Merged from 4.1
2006-05-04 18:35:58 +03:00
unknown
144d2ec9ee Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1
into  mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug16501
2006-05-04 18:36:00 +04:00