- try to catch as many malloc failures as possible and give error messages
ndb/src/ndbapi/ObjectMap.cpp:
New BitKeeper file ``ndb/src/ndbapi/ObjectMap.cpp''
NO_AUTO_VALUE_ON_ZERO mode.
The table->auto_increment_field_not_null variable wasn't reset after
reading a row which may lead to inserting a wrong value to the auto-increment
field to the following row.
The table->auto_increment_field_not_null variable is reset now right after a
row is being written in the read_fixed_length() and the read_sep_field()
functions.
Removed wrong setting of the table->auto_increment_field_not_null variable in
the read_sep_field() function.
mysql-test/t/loaddata.test:
Added a test case for the bug#27586: Wrong autoinc value assigned by LOAD DATA in the
NO_AUTO_VALUE_ON_ZERO mode.
mysql-test/r/loaddata.result:
Added a test case for the bug#27586: Wrong autoinc value assigned by LOAD DATA in the
NO_AUTO_VALUE_ON_ZERO mode.
sql/sql_load.cc:
Bug#27586: Wrong autoinc value assigned by LOAD DATA in the
NO_AUTO_VALUE_ON_ZERO mode.
The table->auto_increment_field_not_null variable is reset now right after a
row is being written in the read_fixed_length() and the read_sep_field()
functions.
Remove wrong setting of the table->auto_increment_field_not_null variable in
the read_sep_field() function.
into mysql.com:/windows/Linux_space/MySQL/mysql-5.0-ndb
include/my_base.h:
Auto merged
sql/ha_ndbcluster.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_trigger.h:
Auto merged
sql/sql_update.cc:
Auto merged
sql/ha_ndbcluster.cc:
Merge
into dev3-240.dev.cn.tlan:/home/justin.he/mysql/mysql-5.0/mysql-5.0-ndb-bj.merge
sql/ha_ndbcluster.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/sql_table.cc:
Auto merged
In certain cases AFTER UPDATE/DELETE triggers on NDB tables that referenced
subject table didn't see the results of operation which caused invocation
of those triggers. In other words AFTER trigger invoked as result of update
(or deletion) of particular row saw version of this row before update (or
deletion).
The problem occured because NDB handler in those cases postponed actual
update/delete operations to be able to perform them later as one batch.
This fix solves the problem by disabling this optimization for particular
operation if subject table has AFTER trigger for this operation defined.
To achieve this we introduce two new flags for handler::extra() method:
HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH.
These are called if there exists AFTER DELETE/UPDATE triggers during a
statement that potentially can generate calls to delete_row()/update_row().
This includes multi_delete/multi_update statements as well as insert statements
that do delete/update as part of an ON DUPLICATE statement.
include/my_base.h:
Added HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH to inform handler when batching of delete/update is not possible.
mysql-test/r/ndb_trigger.result:
Bug #26242 UPDATE with subquery and triggers failing with cluster tables
---
Added new test cases
mysql-test/t/ndb_trigger.test:
Bug #26242 UPDATE with subquery and triggers failing with cluster tables
---
Added new test cases
sql/ha_ndbcluster.cc:
Bug #26242 UPDATE with subquery and triggers failing with cluster tables: Use HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH to inform handler when batching of delete/update is not possible
sql/ha_ndbcluster.h:
Bug #26242 UPDATE with subquery and triggers failing with cluster tables: Added member variables for handling of HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH to inform handler when batching of delete/update is not possible
sql/mysql_priv.h:
Added new method prepare_triggers_for_insert_stmt to check if batching of delete/update must be disallowed.
sql/sql_delete.cc:
Use HA_EXTRA_DELETE_CANNOT_BATCH to inform handler when batching of delete is not possible
sql/sql_insert.cc:
Added method prepare_triggers_for_insert_stmt to check if batching of delete/update must be dissallowed.
Use HA_EXTRA_DELETE_CANNOT_BATCH and HA_EXTRA_UPDATE_CANNOT_BATCH to inform handler
when batching of delete/update is not possible
sql/sql_load.cc:
Call prepare_triggers_for_insert_stmt to check if batching of delete/update must be dissallowed and
mark fields used by triggers for the insert statement.
sql/sql_trigger.h:
Added has_triggers to support what particular triggers exist on a table.
sql/sql_update.cc:
Use HA_EXTRA_UPDATE_CANNOT_BATCH to inform handler when batching of update is not possible
IN/BETWEEN predicates in sorting expressions.
Wrong results may occur when the select list contains an expression
with IN/BETWEEN predicate that differs from a sorting expression by
an additional NOT only.
Added the method Item_func_opt_neg::eq to compare correctly expressions
containing [NOT] IN/BETWEEN.
The eq method inherited from the Item_func returns TRUE when comparing
'a IN (1,2)' with 'a NOT IN (1,2)' that is not, of course, correct.
mysql-test/r/order_by.result:
Added a test case for bug #27532.
mysql-test/t/order_by.test:
Added a test case for bug #27532.
sql/item_cmpfunc.cc:
Fixed bug #27532.
Added the method Item_func_opt_neg::eq to compare correctly expressions
containing [NOT] IN/BETWEEN.
The eq method inherited from the Item_func returns TRUE when comparing
'a IN (1,2)' with 'a NOT IN (1,2)' that is not, of course, correct.
sql/item_cmpfunc.h:
Added the method Item_func_opt_neg::eq to compare correctly expressions
containing [NOT] IN/BETWEEN.
The eq method inherited from the Item_func returns TRUE when comparing
'a IN (1,2)' with 'a NOT IN (1,2)' that is not, of course, correct.
mysql-test/r/ndb_autodiscover.result:
changes ndbd error code to mysqld error code when no cluster connection
sql/ha_ndbcluster.cc:
map 4009 error code to mysql not connected error
sql/handler.cc:
define return codes to ha_table_exists_in_engine to something useful
NOTE: in 5.1 this should call a handlerton method, not horrible ifdef ndb stuff
sql/sql_table.cc:
clearly define what happens on create table if exits/not exists/not connected to engine
The query-cache watch thread was continually allocating new thread entries on the
THD MEM_ROOT, not freed until server exit.
Fixed by using a simple array, auto-expanded as necessary.
sql/ha_ndbcluster.cc:
Use a fixed array (auto-expanded as necessary) for temporary copy of open shares,
don't keep pushing list entries on the THD mem root.
LEFT JOIN
Fixed that in certain situations MATCH ... AGAINST returns false hits
for NULLs produced by LEFT JOIN when there is no fulltext index
available.
mysql-test/r/fulltext_left_join.result:
A test case for BUG#25729.
mysql-test/t/fulltext_left_join.test:
A test case for BUG#25729.
sql/item_func.cc:
concat_ws(NULL) returns empty string instead of NULL. There is not much
sense to calculate relevance for empty strings, thus return 0 immediately
if we got NULL or empty string from concat_ws.
sql/item_func.h:
Item_func_match::concat renamed to concat_ws.
added the check for unique elements count in SET
mysql-test/r/type_set.result:
test result
mysql-test/t/type_set.test:
test case
sql/field.cc:
removed the check for elements count in SET
sql/sql_table.cc:
added the check for unique elements count in SET
into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/type_datetime.result:
Auto merged
sql/field.h:
Auto merged
sql/item.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/gis.result:
SCCS merged
mysql-test/t/gis.test:
SCCS merged
into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
myisam/mi_open.c:
Auto merged
sql/table.cc:
Auto merged
mysql-test/r/create.result:
SCCS merged
mysql-test/t/create.test:
SCCS merged
conditions.
When allocating memory for KEY_FIELD/SARGABLE_PARAM structures the
function update_ref_and_keys did not take into account the fact that
a single row equality could be replaced by several simple equalities.
Fixed by adjusting the counter cond_count accordingly for each subquery
when performing substitution of a row equality for simple equalities.
mysql-test/r/row.result:
Added a test case for bug #27154.
mysql-test/t/row.test:
Added a test case for bug #27154.
Pushbuild fixes:
- Make MAX_SEL_ARGS smaller (even 16K records_in_range() calls is
more than it makes sense to do in typical cases)
- Don't call sel_arg->test_use_count() if we've already allocated
more than MAX_SEL_ARGs elements. The test will succeed but will take
too much time for the test suite (and not provide much value).
mysql-test/r/range.result:
BUG#26624: high mem usage (crash) in range optimizer
Pushbuild fixes: make the test go faster
mysql-test/t/range.test:
BUG#26624: high mem usage (crash) in range optimizer
Pushbuild fixes: make the test go faster
NO_AUTO_VALUE_ON_ZERO mode.
In the NO_AUTO_VALUE_ON_ZERO mode the table->auto_increment_field_not_null
variable is used to indicate that a non-NULL value was specified by the user
for an auto_increment column. When an INSERT .. ON DUPLICATE updates the
auto_increment field this variable is set to true and stays unchanged for the
next insert operation. This makes the next inserted row sometimes wrongly have
0 as the value of the auto_increment field.
Now the fill_record() function resets the table->auto_increment_field_not_null
variable before filling the record.
The table->auto_increment_field_not_null variable is also reset by the
open_table() function for a case if we missed some auto_increment_field_not_null
handling bug.
Now the table->auto_increment_field_not_null is reset at the end of the
mysql_load() function.
Reset the table->auto_increment_field_not_null variable after each
write_row() call in the copy_data_between_tables() function.
sql/field_conv.cc:
Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the
NO_AUTO_VALUE_ON_ZERO mode.
A comment is corrected.
sql/handler.cc:
Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the
NO_AUTO_VALUE_ON_ZERO mode.
Now the handler::update_auto_increment() function doesn't reset the
table->auto_increment_field_not_null variable as it is done in the
fill_record() function.
sql/sql_base.cc:
Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the
NO_AUTO_VALUE_ON_ZERO mode.
Now the fill_record() function resets the table->auto_increment_field_not_null
variable before filling the record.
The table->auto_increment_field_not_null variable is also reset by the
open_table() function for a case if we missed some auto_increment_field_not_null
handling bug.
sql/sql_insert.cc:
Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the
NO_AUTO_VALUE_ON_ZERO mode.
Now the the table->auto_increment_field_not_null is reset at the end of the
mysql_insert() an in the select_insert class destructor.
sql/sql_load.cc:
Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the
NO_AUTO_VALUE_ON_ZERO mode.
Now the table->auto_increment_field_not_null is reset at the end of the
mysql_load() function.
sql/sql_table.cc:
Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the
NO_AUTO_VALUE_ON_ZERO mode.
Reset the table->auto_increment_field_not_null variable after each
write_row() call in the copy_data_between_tables() function.
sql/table.h:
Bug#23233: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE in the
NO_AUTO_VALUE_ON_ZERO mode.
A comment added.
mysql-test/r/insert_update.result:
Added the test case for the bug#23233: 0 as LAST_INSERT_ID() after
INSERT .. ON DUPLICATE in the NO_AUTO_VALUE_ON_ZERO mode.
mysql-test/t/insert_update.test:
Added the test case for the bug#23233: 0 as LAST_INSERT_ID() after
INSERT .. ON DUPLICATE in the NO_AUTO_VALUE_ON_ZERO mode.
ARCHIVE table
ARCHIVE table was truncated by REPAIR TABLE ... USE_FRM statement.
The table handler returned its file name extensions in a wrong order.
REPAIR TABLE believed it has to use the meta file to create a new table
from it.
With the fixed order, REPAIR TABLE does now use the data file to create
a new table. So REPAIR TABLE ... USE_FRM works well with ARCHIVE engine
now.
This issue affects 5.0 only, since in 5.1 ARCHIVE engine stores meta
information and data in the same file.
mysql-test/r/archive.result:
A test case for bug#26138.
mysql-test/t/archive.test:
A test case for bug#26138.
sql/examples/ha_example.cc:
Added a comment.
sql/ha_archive.cc:
First element of engine file name extentions array should be meta/index
file extention. Second element - data file extention. This is true
for engines that have separate meta/index file and data file.
Reoder ha_archive_exts elements to meet described above requirement.
sql/handler.h:
Added a comment.
sql/sql_table.cc:
Added a comment.