Changes in SQL parser:
* Change default mode of SELECT from "lock in share mode"
to "consistent read".
* Remove support from SELECT for specifying "consistent read".
* Add support in SELECT for specifying "lock in share mode".
* Change all uses of SQL parser to specify "lock in share mode".
* Modify syntax so that the only valid top-level statement is
a procedure definition, since it's the only one that actually
works.
* Add support for lock waits.
sql/ha_innodb.cc:
Applied innodb-5.1-ss660 snapshot.
Document better the "bool table_id" flag.
storage/innobase/btr/btr0cur.c:
Applied innodb-5.1-ss660 snapshot.
btr_cur_search_to_nth_level(): Reacquire btr_search_latch after
inserting to the insert buffer. This was noticed while analysing
Bug#19801, but this should not fix this bug since, according to
Heikki, btr_search_latch is not reserved during an insert.
storage/innobase/configure.in:
Applied innodb-5.1-ss660 snapshot.
Add -Wpointer-arith to CFLAGS when using GCC.
storage/innobase/data/data0type.c:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/dict/dict0crea.c:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/dict/dict0dict.c:
Applied innodb-5.1-ss660 snapshot.
Make dict_remove_db_name() non-static.
storage/innobase/ibuf/ibuf0ibuf.c:
Applied innodb-5.1-ss660 snapshot.
ibuf_fixed_addr_page(): Add parameter space. As the insert buffer
B-tree is only located in the system tablespace (space 0),
IBUF_TREE_ROOT_PAGE_NO is only special in space 0.
storage/innobase/include/data0type.h:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/include/dict0dict.h:
Applied innodb-5.1-ss660 snapshot.
Make dict_remove_db_name() non-static.
storage/innobase/include/pars0grm.h:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/include/pars0pars.h:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/include/que0que.h:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/include/sync0rw.ic:
Applied innodb-5.1-ss660 snapshot.
rw_lock_s_unlock_func(): Change a debug assertion to a
production assertion in order to track down Bug#19081.
storage/innobase/include/trx0trx.h:
Applied innodb-5.1-ss660 snapshot.
trx_sig_send() always succeeds or asserts.
storage/innobase/include/ut0ut.h:
Applied innodb-5.1-ss660 snapshot.
Document better the "bool table_id" flags.
storage/innobase/mem/mem0mem.c:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/pars/lexyy.c:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/pars/pars0grm.c:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/pars/pars0grm.h:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/pars/pars0grm.y:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/pars/pars0lex.l:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/pars/pars0pars.c:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/que/que0que.c:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/row/row0mysql.c:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/row/row0sel.c:
Applied innodb-5.1-ss660 snapshot.
* Disable prefetch and adaptive hash index for tables
with rows over 1024 bytes in InnoDB's SQL parser.
* row_sel_try_search_shortcut(): Do not return SEL_FOUND
when the record was not found. This bug was introduced
in MySQL/InnoDB 5.0.3, but luckily it should never
manifest itself, given that existing InnoDB SQL code
never makes use of consistent reads.
* Don't take unnecesary locks on supremum records when the
srv_locks_unsafe_for_binlog option is enabled. Fixes an
assertion failure in the innodb_unsafe_binlog testcase
when compiled with UNIV_DEBUG.
storage/innobase/row/row0upd.c:
Applied innodb-5.1-ss660 snapshot.
storage/innobase/trx/trx0roll.c:
Applied innodb-5.1-ss660 snapshot.
trx_sig_send() always succeeds or asserts.
storage/innobase/trx/trx0trx.c:
Applied innodb-5.1-ss660 snapshot.
trx_sig_send() always succeeds or asserts.
storage/innobase/ut/ut0ut.c:
Applied innodb-5.1-ss660 snapshot.
Document better the "bool table_id" flags.
mysql-test/mysql-test-run.pl:
Fix problem with checking that all im processes has shutdown cleanly
When it was detected that one of "im mysqlds" didn't shutdown, last was called to break the loop, but it only broke the inner loop.
Remove the while(0) loop and make this easier by setting $clean_shutdown to 0 if any such problem is detected.
innobase/btr/btr0cur.c:
Applied innodb-5.0-ss660 snapshot.
btr_cur_search_to_nth_level(): Reacquire btr_search_latch after
inserting to the insert buffer. This was noticed while analyzing
Bug#19081 but this shold not fix this bug since according to
Heikki, btr_search_latch is not reserved during an insert.
innobase/ibuf/ibuf0ibuf.c:
Applied innodb-5.0-ss660 snapshot.
ibuf_fixed_addr_page(): Add parameter space. As the insert buffer
B-tree is only located in the system tablespace (space 0),
IBUF_TREE_ROOT_PAGE_NO is only special in space 0.
innobase/include/sync0rw.ic:
Applied innodb-5.0-ss660 snapshot.
rw_lock_s_unlock_func(): Change a debug assertion to a
production assertion in order to track down Bug#19081.
innobase/ibuf/ibuf0ibuf.c:
Applied innodb-4.1-ss32 snapshot.
ibuf_fixed_addr_page(): Add parameter space. As the insert
buffer B-tree is only located in the system tablespace
(space 0), IBUF_TREE_ROOT_PAGE_NO is only special in space 0.
The problem was in that opt_sum_query() replaced MIN/MAX functions
with the corresponding constant found in a key, but due to imprecise
representation of float numbers, when evaluating the where clause,
this comparison failed.
When MIN/MAX optimization detects that all tables can be removed,
also remove all conjuncts in a where clause that refer to these
tables. As a result of this fix, these conditions are not evaluated
twice, and in the case of float number comparisons we do not discard
result rows due to imprecise float representation.
As a side-effect this fix also corrects an unnoticed problem in
bug 12882.
mysql-test/r/func_group.result:
BUG#20954 - test result adjustment.
Adjusted the test result of bug 12882 which was not preperly fixed.
The current patch corrects the problem that was fully corrected by the
patch for 12882.
The problem was that opt_sum_query() indicated that the optimizer may
remove all tables because all MIN/MAX/COUNT functions are constants,
but this lead to an empty result instead of NULL because the WHERE
clause was still evaluated.
The current fix removes all conjuncts in the where clause that
reference the removed tables, and thus corrects the problem.
mysql-test/r/select.result:
BUG#20954 - added test
mysql-test/r/subselect.result:
BUG#20954 - test result adjustment.
The fix removes those conditions in a where clause that refer to
tables optimized away by MIN/MAX optimization (opt_sum_query()).
mysql-test/t/select.test:
BUG#20954 - added test
sql/sql_select.cc:
Fix for BUG#20954: avg(keyval) retuns 0.38 but max(keyval) returns an empty set
When MIN/MAX optimization detects that all tables can be removed,
also remove all conjuncts in a where clause that refer to these
tables. As a result of this fix, these conditions are not evaluated
twice, and in the case of float number comparisons we do not discard
result rows due to imprecise float representation.
As a side-effect this fix also corrects an unnoticed problem in
bug 12882.
When there is no index defined filesort is used to sort the result of a
query. If there is a function in the select list and the result set should be
ordered by it's value then this function will be evaluated twice. First time to
get the value of the sort key and second time to send its value to a user.
This happens because filesort when sorts a table remembers only values of its
fields but not values of functions.
All functions are affected. But taking into account that SP and UDF functions
can be both expensive and non-deterministic a temporary table should be used
to store their results and then sort it to avoid twice SP evaluation and to
get a correct result.
If an expression referenced in an ORDER clause contains a SP or UDF
function, force the use of a temporary table.
A new Item_processor function called func_type_checker_processor is added
to check whether the expression contains a function of a particular type.
mysql-test/t/udf.test:
Added test case for bug#19862: Sort with filesort by function evaluates function twice
mysql-test/t/sp.test:
Added test case for bug#19862: Sort with filesort by function evaluates function twice
mysql-test/r/sp.result:
Added test case for bug#19862: Sort with filesort by function evaluates function twice
mysql-test/r/udf.result:
Added test case for bug#19862: Sort with filesort by function evaluates function twice
sql/sql_select.cc:
Fixed bug#19862: Sort with filesort by function evaluates function twice
If an expression referenced in an ORDER clause contains a SP or UDF
function, force the use of a temporary table.
sql/item_func.h:
Fixed bug#19862: Sort with filesort by function evaluates function twice
A new Item_processor function called func_type_checker_processor is added
to check whether the expression contains a function of a particular type.
sql/item.h:
Fixed bug#19862: Sort with filesort by function evaluates function twice
A new Item_processor function called func_type_checker_processor is added
to check whether the expression contains a function of a particular type.
sql/item_func.cc:
Fixed bug#19862: Sort with filesort by function evaluates function twice
A new Item_processor function called func_type_checker_processor is added
to check whether the expression contains a function of a particular type.
When executing INSERT over a view with calculated columns it was assuming all
elements of the fields collection are actually Item_field instances.
This may not be true when inserting into a view and that view has columns that are
such expressions that allow updating (like setting a collation for example).
Corrected to access field information through the filed_for_view_update() function and
retrieve correctly the field info even for "update-friendly" non-Item_field items.
mysql-test/r/view.result:
Bug #21086: server crashes when VIEW defined with a SELECT with COLLATE clause is called
- test suite
mysql-test/t/view.test:
Bug #21086: server crashes when VIEW defined with a SELECT with COLLATE clause is called
- test suite
sql/item_strfunc.h:
Bug #21086: server crashes when VIEW defined with a SELECT with COLLATE clause is called
- obvious typo fixed
sql/sql_base.cc:
Bug #21086: server crashes when VIEW defined with a SELECT with COLLATE clause is called
- must access field information through the filed_for_view_update() function to retrieve
correctly the field info even for "update-friendly" non-Item_field items.
Emit an error instead of doing ASSERT
mysql-test/r/create_not_windows.result:
update result
mysql-test/t/create_not_windows.test:
Add test case for bug #16532: mysql server assert in debug if table definition is removed
sql/sql_table.cc:
it could happen that an user deletes the frm file on OS level.
In addition if the table was already opened, the file system level
check for existance of table.frm will pass but get_cached_table_share()
will return non-NULL value. In this case we will emit the standard
error that the table exist. The error case is quite obscure but error
message is better than a sigabort.
(Re-apply a patch from the general tree to the clone.)
mysql-test/mysql-test-run.pl:
"mysql-test-run.pl" must write a "Logging:" line for the evaluation of RPM build tests.
(Re-apply a patch from the general tree to the clone.)
BUG#20850: Assert during slave shutdown in many rpl_* tests
This patch has already been applied to 5.1.
sql/slave.cc:
BUG#20850: Assert during slave shutdown in many rpl_* tests
This patch has already been applied to 5.1.
when calculating GROUP_CONCAT all blob fields are transformed
to varchar when making the temp table.
However a varchar has at max 2 bytes for length.
This fix makes the conversion only for blobs whose max length
is below that limit.
Otherwise blob field is created by make_string_field() call.
mysql-test/r/func_gconcat.result:
Bug#16712: group_concat returns odd srting insead of intended result
* testsuite for the bug
mysql-test/t/func_gconcat.test:
Bug#16712: group_concat returns odd srting insead of intended result
* testsuite for the bug
sql/item_sum.cc:
Bug#16712: group_concat returns odd srting insead of intended result
* force blob->varchar conversion for small enough blobs only
sql/sql_select.cc:
Bug#16712: group_concat returns odd srting insead of intended result
* force blob->varchar conversion for small enough blobs only
into neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
mysql-test/mysql-test-run.pl:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
a non-correlated single-row subquery over information schema.
The function get_all_tables filling all information schema
tables reset lex->sql_command to SQLCOM_SHOW_FIELDS. After
this the function could evaluate partial conditions related to
some columns. If these conditions contained a subquery over
information schema it led to a wrong evaluation and a wrong
result set.
This bug was already fixed in 5.1.
This patch follows the way how it was done in 5.1 where
the value of lex->sql_command is set to SQLCOM_SHOW_FIELDS
in get_all_tables only for the calls of the function
open_normal_and_derived_tables and is restored after these
calls.
mysql-test/r/information_schema.result:
Added a test case for bug #21231.
mysql-test/t/information_schema.test:
Added a test case for bug #21231.
- Fix problems in the "Interval walking" partition interval analyzer.
mysql-test/r/partition_pruning.result:
BUG#20257: Add more testcases for partition pruning
mysql-test/t/partition_pruning.test:
BUG#20257: Add more testcases for partition pruning
sql/sql_partition.cc:
BUG#20257: Fix partition pruning for BIGINT UNSIGNED, interval walking:
- provide special handling for an edge case of interval of size 4G-1.
- Store interval size in ulonglong, not uint (it was possible to miss partitions this way)
- In get_next_partition_via_walking(), interpret the value of walked-over field as having the
same "signedness" as field (this is so because this value was obtained by calling field->val_int())
- Remove out of date todo comment.
- Send confusing output to /dev/null
mysql-test/t/mysqlbinlog.test:
Send confusing error messages to /dev/null so they don't appear in erro log if test case fails
into trift2.:/M50/merge-4.1-to-5.0
VC++Files/libmysqld/libmysqld.dsp:
Auto merged
VC++Files/libmysqld/libmysqld.vcproj:
Auto merged
VC++Files/libmysqld/libmysqld_ia64.dsp:
Auto merged
VC++Files/mysqldemb/mysqldemb.dsp:
Auto merged
VC++Files/sql/mysqld.dsp:
Auto merged
VC++Files/sql/mysqld.vcproj:
Auto merged
VC++Files/sql/mysqld_ia64.dsp:
Auto merged
VC++Files/sql/mysqldmax.dsp:
Auto merged
sql/field.cc:
Merge a backport == Null-merge == "ul".
sql/field.h:
Merge a backport == Null-merge == "ul".
sql/sql_locale.cc:
Changes were already present (and even better) == Null-merge == "ul".
into trift2.:/M50/merge-4.1-to-5.0
strings/strtod.c:
Manual merge: Null merge with header file cleanup ("my_base.h" includes "my_global.h", so we do not need both).
into trift2.:/M50/merge-4.1-to-5.0
mysql-test/r/date_formats.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_locale.cc:
Auto merged
sql/item_timefunc.cc:
Merging by "ul", as asked in the original changeset.
support-files/mysql.spec.sh:
Manual merge, keeping alphabetic order.
Filter out strange control characters, messes up logs
netware/BUILD/mwasmnlm:
Filter out strange control characters, messes up logs
netware/BUILD/mwccnlm:
Filter out strange control characters, messes up logs
netware/BUILD/mwldnlm:
Filter out strange control characters, messes up logs
(well, im_options in this case, but using existing bug report)
mysql-test/t/disabled.def:
disable im_options test as it's non-deterministic. reopen bug
into willster.(none):/home/stewart/Documents/MySQL/5.1/main
BitKeeper/etc/config:
Auto merged
sql/opt_range.cc:
Auto merged
storage/ndb/src/kernel/blocks/ERROR_codes.txt:
Auto merged
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
Auto merged
storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp:
Auto merged
storage/ndb/test/ndbapi/testDict.cpp:
Auto merged
storage/ndb/test/run-test/daily-basic-tests.txt:
Auto merged
mysql-test/Makefile.am:
manual merge
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
manual merge
subqueries on information schema that use MIN/MAX aggregation.
Execution of some correlated subqueries may set the value
of null_row to 1 for tables used in the subquery.
If the the subquery is on information schema it causes
rejection of any row for the following executions of
the subquery in the case when an optimization filtering
by some condition is applied.
The fix restores the value of the null_row flag for
each execution of a subquery on information schema.
mysql-test/r/information_schema.result:
Added a test case for bug #18925.
mysql-test/t/information_schema.test:
Added a test case for bug #18925.
sql/sql_show.cc:
Fixed bug #18925.
Execution of some correlated subqueries may set the value
of null_row to 1 for tables used in the subquery.
If the the subquery is on information schema it causes
rejection of any row for the following execitions of
the subquery in the case when an optimization filtering
by some condition is applied.
The fix restores the value of the null_row flag for
each execution of a subquery on information schema.
Fixes for change that makes default appear in NODEGROUP as it should be instead of 0 which is an error
mysql-test/r/ndb_dd_backuprestore.result:
Fixes for change that makes default appear in NODEGROUP as it should be instead of 0 which is an error
mysql-test/r/ndb_partition_range.result:
Fixes for change that makes default appear in NODEGROUP as it should be instead of 0 which is an error