create table t1 (a smallint primary key auto_increment);
insert into t1 values(32767);
insert into t1 values(NULL);
ERROR 1062 (23000): Duplicate entry '32767' for key 'PRIMARY
Now on always gets error HA_ERR_AUTOINC_RANGE=167 "Out of range value for column", independent of
store engine, SQL Mode or number of inserted rows. This is an unique error that is easier to test for in replication.
Another bug fix is that we now get an error when trying to insert a too big auto-generated value, even in non-strict mode.
Before one get insted the max column value inserted.
This patch also fixes some issues with inserting negative numbers in an auto-increment column.
Fixed the ER_DUP_ENTRY and HA_ERR_AUTOINC_ERANGE are compared the same between master and slave.
This ensures that replication works between an old server to a new slave for auto-increment overflow errors.
Added SQLSTATE errors for handler errors
Smaller bug fixes:
* Added warnings for duplicate key errors when using INSERT IGNORE
* Fixed bug when using --skip-log-bin followed by --log-bin, which did set log-bin to "0"
* Allow one to see how cmake is called by using --just-print --just-configure
BUILD/FINISH.sh:
--just-print --just-configure now shows how cmake would be invoked. Good for understanding parameters to cmake.
cmake/configure.pl:
--just-print --just-configure now shows how cmake would be invoked. Good for understanding parameters to cmake.
include/CMakeLists.txt:
Added handler_state.h
include/handler_state.h:
SQLSTATE for handler error messages.
Required for HA_ERR_AUTOINC_ERANGE, but solves also some other cases.
mysql-test/extra/binlog_tests/binlog.test:
Fixed old wrong behaviour
Added more tests
mysql-test/extra/binlog_tests/binlog_insert_delayed.test:
Reset binary log to only print what's necessary in show_binlog_events
mysql-test/extra/rpl_tests/rpl_auto_increment.test:
Update to new error codes
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
Ignore warnings as this depends on how the test is run
mysql-test/include/strict_autoinc.inc:
On now gets an error on overflow
mysql-test/r/auto_increment.result:
Update results after fixing error message
mysql-test/r/auto_increment_ranges_innodb.result:
Test new behaviour
mysql-test/r/auto_increment_ranges_myisam.result:
Test new behaviour
mysql-test/r/commit_1innodb.result:
Added warnings for duplicate key error
mysql-test/r/create.result:
Added warnings for duplicate key error
mysql-test/r/insert.result:
Added warnings for duplicate key error
mysql-test/r/insert_select.result:
Added warnings for duplicate key error
mysql-test/r/insert_update.result:
Added warnings for duplicate key error
mysql-test/r/mix2_myisam.result:
Added warnings for duplicate key error
mysql-test/r/myisam_mrr.result:
Added warnings for duplicate key error
mysql-test/r/null_key.result:
Added warnings for duplicate key error
mysql-test/r/replace.result:
Update to new error codes
mysql-test/r/strict_autoinc_1myisam.result:
Update to new error codes
mysql-test/r/strict_autoinc_2innodb.result:
Update to new error codes
mysql-test/r/strict_autoinc_3heap.result:
Update to new error codes
mysql-test/r/trigger.result:
Added warnings for duplicate key error
mysql-test/r/xtradb_mrr.result:
Added warnings for duplicate key error
mysql-test/suite/binlog/r/binlog_innodb_row.result:
Updated result
mysql-test/suite/binlog/r/binlog_row_binlog.result:
Out of range data for auto-increment is not inserted anymore
mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
Updated result
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
Out of range data for auto-increment is not inserted anymore
mysql-test/suite/binlog/r/binlog_unsafe.result:
Updated result
mysql-test/suite/innodb/r/innodb-autoinc.result:
Update to new error codes
mysql-test/suite/innodb/r/innodb-lock.result:
Updated results
mysql-test/suite/innodb/r/innodb.result:
Updated results
mysql-test/suite/innodb/r/innodb_bug56947.result:
Updated results
mysql-test/suite/innodb/r/innodb_mysql.result:
Updated results
mysql-test/suite/innodb/t/innodb-autoinc.test:
Update to new error codes
mysql-test/suite/maria/maria3.result:
Updated result
mysql-test/suite/maria/mrr.result:
Updated result
mysql-test/suite/optimizer_unfixed_bugs/r/bug43617.result:
Updated result
mysql-test/suite/rpl/r/rpl_auto_increment.result:
Update to new error codes
mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff:
Updated results
mysql-test/suite/rpl/r/rpl_loaddatalocal.result:
Updated results
mysql-test/t/auto_increment.test:
Update to new error codes
mysql-test/t/auto_increment_ranges.inc:
Test new behaviour
mysql-test/t/auto_increment_ranges_innodb.test:
Test new behaviour
mysql-test/t/auto_increment_ranges_myisam.test:
Test new behaviour
mysql-test/t/replace.test:
Update to new error codes
mysys/my_getopt.c:
Fixed bug when using --skip-log-bin followed by --log-bin, which did set log-bin to "0"
sql/handler.cc:
Ignore negative values for signed auto-increment columns
Always give an error if we get an overflow for an auto-increment-column (instead of inserting the max value)
Ensure that the row number is correct for the out-of-range-value error message.
******
Fixed wrong printing of column namn for "Out of range value" errors
Fixed that INSERT_ID is correctly replicated also for out-of-range autoincrement values
Fixed that print_keydup_error() can also be used to generate warnings
******
Return HA_ERR_AUTOINC_ERANGE (167) instead of ER_WARN_DATA_OUT_OF_RANGE for auto-increment overflow
sql/handler.h:
Allow INSERT IGNORE to continue also after out-of-range inserts.
Fixed that print_keydup_error() can also be used to generate warnings
sql/log_event.cc:
Added DBUG_PRINT
Fixed the ER_AUTOINC_READ_FAILED, ER_DUP_ENTRY and HA_ERR_AUTOINC_ERANGE are compared the same between master and slave.
This ensures that replication works between an old server to a new slave for auto-increment overflow errors.
sql/sql_insert.cc:
Add warnings for duplicate key errors when using INSERT IGNORE
sql/sql_state.c:
Added handler errors
sql/sql_table.cc:
Update call to print_keydup_error()
storage/innobase/handler/ha_innodb.cc:
Fixed increment handling of auto-increment columns to be consistent with rest of MariaDB.
storage/xtradb/handler/ha_innodb.cc:
Fixed increment handling of auto-increment columns to be consistent with rest of MariaDB.
Before this fix, the ha_read_last_count status variable was defined and
updated internally, for never exposed as a system variable.
This fix exposes the system variable as "Handler_read_last",
for completness of the Handler_read_* system variables interface.
Adjusted tests results accordingly.
- Moved some code from innodb_plugin to xtradb, to ensure that all tests runs
- Did changes in pbxt and maria storage engines becasue of changes in thd->query
- Reverted wrong code in sql_table.cc for how ROW_FORMAT is used.
This is a re-commit of Monty's merge to eliminate an extra commit from
MySQL-5.1.42 that was accidentally included in the merge.
This is a merge of the MySQL 5.1.41 clone-off (clone-5.1.41-build). In
case there are any extra changes done before final MySQL 5.1.41
release, these will need to be merged later before MariaDB 5.1.41
release.
* Finished Monty and Jani's merge
* Some InnoDB tests still fail (because it's old xtradb code run against
newer testsuite). They are expected to go after mergning with the latest
xtradb.
In create_myisam_from_heap() mark all errors as fatal except
HA_ERR_RECORD_FILE_FULL for a HEAP table.
Not doing so could lead to problems, e.g. in a case when a
temporary MyISAM table gets overrun due to its MAX_ROWS limit
while executing INSERT/REPLACE IGNORE ... SELECT.
The SELECT execution was aborted, but the error was
converted to a warning due to IGNORE clause, so neither 'ok'
nor 'error' packet could be sent back to the client. This
condition led to hanging client when using 5.0 server, or
assertion failure in 5.1.
mysql-test/r/insert_select.result:
Added a test case for bug #46075.
mysql-test/t/insert_select.test:
Added a test case for bug #46075.
sql/sql_select.cc:
In create_myisam_from_heap() mark all errors as fatal except
HA_ERR_RECORD_FILE_FULL for a HEAP table.
'INSERT ... SELECT' statements
The code that produces result rows expected that a duplicate row
error could not occur in INSERT ... SELECT statements with
unfulfilled WHERE conditions. This may happen, however, if the
SELECT list contains only aggregate functions.
Fixed by checking if an error occured before trying to send EOF
to the client.
mysql-test/r/insert_select.result:
Bug#44306: Test result
mysql-test/t/insert_select.test:
Bug#44306: Test case
sql/sql_select.cc:
Bug#44306: Fix
into sunlight.local:/local_work/merge-5.1-opt-mysql
libmysql/libmysql.c:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/r/insert_select.result:
Auto merged
mysql-test/t/insert_select.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/protocol.cc:
Auto merged
sql/sql_class.h:
Auto merged
mysql-test/r/type_datetime.result:
Manually merged
mysql-test/t/type_datetime.test:
Manually merged
sql/item_cmpfunc.cc:
Manually merged
sql/item_cmpfunc.h:
Manually merged
sql/sql_insert.cc:
Manually merged
led to creating corrupted index.
While execution of the CREATE .. SELECT SQL_BUFFER_RESULT statement the
engine->start_bulk_insert function was called twice. On the first call
On the first call MyISAM disabled all non-unique indexes and on the second
call it decides to not re-enable them because all indexes was disabled.
Due to this no indexes was actually created during CREATE TABLE thus
producing crashed table.
Now the select_inset class has is_bulk_insert_mode flag which prevents
calling the start_bulk_insert function twice.
The flag is set in the select_create::prepare, select_insert::prepare2
functions and the select_insert class constructor.
The flag is reset in the select_insert::send_eof function.
mysql-test/t/insert_select.test:
A test case is added for the bug#30384: Having SQL_BUFFER_RESULT option in the
CREATE .. KEY(..) .. SELECT led to creating corrupted index.
mysql-test/r/insert_select.result:
A test case is added for the bug#30384: Having SQL_BUFFER_RESULT option in the
CREATE .. KEY(..) .. SELECT led to creating corrupted index.
sql/sql_class.h:
Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT
led to creating corrupted index.
The is_bulk_insert_mode flag is added to the select_insert class.
sql/sql_insert.cc:
Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT
led to creating corrupted index.
The is_bulk_insert_mode is set in the select_create::prepare, select_insert::prepare2
functions and the select_insert class constructor.
The flag is reset in the select_insert::send_eof function.
into mysql.com:/home/hf/work/29717/my51-29717
mysql-test/r/group_by.result:
Auto merged
mysql-test/r/insert_select.result:
Auto merged
mysql-test/t/group_by.test:
Auto merged
mysql-test/t/insert_select.test:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_select.h:
Auto merged
into gleb.loc:/home/uchum/work/bk/5.1-opt
libmysql/libmysql.c:
Merge with 5.0-opt.
mysql-test/r/insert_select.result:
Merge with 5.0-opt.
mysql-test/r/mysqlbinlog.result:
Merge with 5.0-opt.
mysql-test/r/rpl_change_master.result:
Merge with 5.0-opt.
mysql-test/r/view.result:
Merge with 5.0-opt.
mysql-test/t/insert_select.test:
Merge with 5.0-opt.
mysql-test/t/mysqlbinlog.test:
Merge with 5.0-opt.
mysql-test/t/rpl_change_master.test:
Merge with 5.0-opt.
mysql-test/t/view.test:
Merge with 5.0-opt.
sql/item.cc:
Merge with 5.0-opt.
sql/item.h:
Merge with 5.0-opt.
sql/log_event.cc:
Merge with 5.0-opt.
sql/sql_select.cc:
Merge with 5.0-opt.
INSERT into table from SELECT from the same table
with ORDER BY and LIMIT was inserting other data
than sole SELECT ... ORDER BY ... LIMIT returns.
One part of the patch for bug #9676 improperly pushed
LIMIT to temporary table in the presence of the ORDER BY
clause.
That part has been removed.
sql/sql_select.cc:
Fixed bug #29095.
One part of the patch for bug #9676 improperly pushed
LIMIT to temporary table in the presence of the ORDER BY
clause.
That part has been removed.
mysql-test/t/insert_select.test:
Expanded the test case for bug #9676.
Created a test case for bug #29095.
mysql-test/r/insert_select.result:
Expanded the test case for bug #9676.
Created a test case for bug #29095.
mysql-test/r/auto_increment.result:
result fix
mysql-test/r/create.result:
result fix
mysql-test/r/insert.result:
result fix
mysql-test/r/insert_select.result:
result fix
mysql-test/r/insert_update.result:
result fix
mysql-test/r/key.result:
result fix
mysql-test/r/null.result:
result fix
mysql-test/r/null_key.result:
result fix
mysql-test/r/ps_2myisam.result:
result fix
mysql-test/r/ps_3innodb.result:
result fix
mysql-test/r/ps_4heap.result:
result fix
mysql-test/r/ps_5merge.result:
result fix
mysql-test/r/ps_6bdb.result:
result fix
mysql-test/r/ps_7ndb.result:
result fix
mysql-test/r/strict.result:
result fix
mysql-test/r/view.result:
result fix
mysql-test/r/warnings.result:
result fix
mysql-test/t/strict.test:
test fix
into mysql.com:/home/hf/work/mrg/mysql-5.1-opt
mysql-test/r/insert_select.result:
Auto merged
mysql-test/t/insert_select.test:
Auto merged
sql/field.h:
Auto merged
sql/item.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/sql_select.h:
Auto merged
mysql-test/r/create.result:
merging
mysql-test/r/temp_table.result:
SCCS merged
mysql-test/r/type_float.result:
merging
mysql-test/r/union.result:
merging
mysql-test/t/temp_table.test:
merging
in index search MySQL was not explicitly
suppressing warnings. And if the context
happens to enable warnings (e.g. INSERT ..
SELECT) the warnings resulting from converting
the data the key is compared to are
reported to the client.
Fixed by suppressing warnings when converting
the data to the same type as the key parts.
mysql-test/r/insert_select.result:
Bug #26207: test case
mysql-test/t/insert_select.test:
Bug #26207: test case
sql/sql_select.h:
Bug #26207: supress warnings when converting
data of the same type to key buffer format.
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/insert_update.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/r/subselect3.result:
Auto merged
mysql-test/r/type_blob.result:
Auto merged
mysql-test/t/insert_update.test:
Auto merged
mysql-test/t/select.test:
Auto merged
BitKeeper/deleted/.del-bdb.result:
Auto merged
mysql-test/extra/binlog_tests/blackhole.test:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_union.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
storage/blackhole/ha_blackhole.cc:
Auto merged
mysql-test/r/binlog_stm_blackhole.result:
manual merge
mysql-test/r/insert_select.result:
manual merge
mysql-test/r/subselect.result:
manual merge
mysql-test/r/update.result:
manual merge
mysql-test/t/insert_select.test:
manual merge
mysql-test/t/subselect.test:
manual merge
sql/sql_help.cc:
manual merge
sql/sql_insert.cc:
manual merge
sql/sql_update.cc:
manual merge
UPDATE contains wrong data if the SELECT employs a temporary table.
If the UPDATE values of the INSERT .. SELECT .. ON DUPLICATE KEY UPDATE
statement contains fields from the SELECT part and the select employs a
temporary table then those fields will contain wrong values because they
aren't corrected to get data from the temporary table.
The solution is to add these fields to the selects all_fields list,
to store pointers to those fields in the selects ref_pointer_array and
to access them via Item_ref objects.
The substitution for Item_ref objects is done in the new function called
Item_field::update_value_transformer(). It is called through the
item->transform() mechanism at the end of the select_insert::prepare()
function.
sql/item.cc:
Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
UPDATE contains wrong data if the SELECT employs a temporary table.
The new method Item_field::update_value_transformer() is added. It
substitutes fields in the update values list for references
(Item_ref objects) to them.
sql/item.h:
Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
UPDATE contains wrong data if the SELECT employs a temporary table.
The update_value_transformer() method is added to the Item and to the
Item_field classes.
sql/sql_insert.cc:
Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
UPDATE contains wrong data if the SELECT employs a temporary table.
Traverse update values and substitute fields from the select for
references (Item_ref objects) to them.
sql/sql_select.cc:
Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
UPDATE contains wrong data if the SELECT employs a temporary table.
Traverse update values and substitute fields from the select for
references (Item_ref objects) to them.
mysql-test/r/insert_select.result:
Added a test case for bug#16630: The update fields of the INSERT .. SELECT ..
ON DUPLICATE KEY UPDATE contains wrong data if the SELECT employs a
temporary table.
mysql-test/t/insert_select.test:
Added a test case for bug#16630: The update fields of the INSERT .. SELECT ..
ON DUPLICATE KEY UPDATE contains wrong data if the SELECT employs a
temporary table.
into olga.mysql.com:/home/igor/mysql-5.1-opt
BitKeeper/etc/gone:
auto-union
mysql-test/r/insert_select.result:
Auto merged
mysql-test/r/join_outer.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/insert_select.test:
Auto merged
mysql-test/t/join_outer.test:
Auto merged
mysql-test/t/select.test:
Auto merged
mysys/my_getopt.c:
Auto merged
sql/field.h:
Auto merged
sql/field_conv.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
mysql-test/include/mix1.inc:
Manual merge
mysql-test/r/information_schema.result:
Manual merge
mysql-test/r/innodb_mysql.result:
Manual merge
mysql-test/t/information_schema.test:
Manual merge
mysql-test/t/view.test:
Manual merge
mysys/my_pthread.c:
Manual merge
sql/mysql_priv.h:
Manual merge
sql/opt_range.cc:
Manual merge
sql/sql_insert.cc:
Manual merge
sql/sql_update.cc:
Manual merge
inserted.
The select_insert::send_eof() function now resets LAST_INSERT_ID variable if
no rows were inserted.
mysql-test/t/insert_select.test:
Added a test case for bug#23170: LAST_INSERT_ID isn't reset to 0 in INSERT .. SELECT when no rows were inserted.
mysql-test/r/insert_select.result:
Added a test case for bug#23170: LAST_INSERT_ID isn't reset to 0 in INSERT .. SELECT when no rows were inserted.
sql/sql_insert.cc:
Bug#23170: LAST_INSERT_ID isn't reset to 0 in INSERT .. SELECT when no rows were
inserted.The select_insert::send_eof() function now resets LAST_INSERT_ID variable if
no rows were inserted.
updated.
INSERT ... ON DUPLICATE KEY UPDATE reports that a record was updated when
the duplicate key occurs even if the record wasn't actually changed
because the update values are the same as those in the record.
Now the compare_record() function is used to check whether the record was
changed and the update of a record reported only if the record differs
from the original one.
sql/sql_update.cc:
Bug#19978: INSERT .. ON DUPLICATE erroneously reports some records were
updated.
The compare_record() function was changed to non-static one.
sql/sql_insert.cc:
Bug#19978: INSERT .. ON DUPLICATE erroneously reports some records were
updated.
Now the compare_record() function is used to check whether the record was
changed and the update of a record reported only if the record differs
from the original one.
sql/mysql_priv.h:
Bug#19978: INSERT .. ON DUPLICATE erroneously reports some records were
updated.
Added the prototype of the compare_record() function.
mysql-test/t/insert_select.test:
Added a test case for bug#19978: INSERT .. ON DUPLICATE erroneously reports
some records were updated.
mysql-test/r/insert_select.result:
Added a test case for bug#19978: INSERT .. ON DUPLICATE erroneously reports
some records were updated.
into mysql.com:/home/hf/work/embt/my51-embt
libmysqld/lib_sql.cc:
Auto merged
BitKeeper/deleted/.del-bdb.result:
Auto merged
BitKeeper/deleted/.del-bdb.test:
Auto merged
mysql-test/r/insert_select.result:
Auto merged
mysql-test/r/join.result:
Auto merged
mysql-test/t/backup.test:
Auto merged
mysql-test/t/delayed.test:
Auto merged
mysql-test/t/join.test:
Auto merged
mysql-test/t/status.test:
Auto merged
mysql-test/t/trigger.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
mysql-test/mysql-test-run.pl:
merging
mysql-test/r/flush_block_commit.result:
SCCS merged
mysql-test/r/insert.result:
merging
mysql-test/t/innodb.test:
merging
mysql-test/t/insert.test:
merging
sql/share/errmsg.txt:
merging
libmysqld/lib_sql.cc:
check for bootstrap added
mysql-test/include/federated.inc:
disabled in embedded
mysql-test/mysql-test-run.pl:
we disable ssh in embedded server
mysql-test/r/bdb.result:
part moved to bdb_notembedded as it uses binlog
mysql-test/r/flush_block_commit.result:
part moved to flush_block_commit_notembedded
mysql-test/r/insert.result:
part moved to insert_notembedded as delayed works differently in embedded server
mysql-test/r/insert_select.result:
part moved to insert_notembedded as GRANTS usually disabled in embedded server
mysql-test/r/join.result:
access rights hidden in result
mysql-test/t/backup.test:
now available in embedded server
mysql-test/t/bdb.test:
part moved to bdb_notembedded as it uses binlog
mysql-test/t/delayed.test:
code trimmed
mysql-test/t/execution_constants.test:
skipped in embedded-server mode
mysql-test/t/flush_block_commit.test:
moved to flush_block_commit_notembedded
mysql-test/t/information_schema_db.test:
skipped in embedded-server
mysql-test/t/innodb.test:
directories replaced to be embedded-server compliant
mysql-test/t/insert.test:
part moved to insert_notembedded
mysql-test/t/insert_select.test:
part moved to insert_notembedded
mysql-test/t/join.test:
access rights hidden
mysql-test/t/status.test:
skipped in embedded server
mysql-test/t/trigger.test:
directories replaced to be embedded-server compliant
sql/item_strfunc.cc:
extra contexts not needed whan access checks disabled
sql/share/errmsg.txt:
bigger paths reserved to prevent test's fails
mysql-test/r/bdb_notembedded.result:
***MISSING WEAVE***
mysql-test/r/flush_block_commit_notembedded.result:
added
mysql-test/r/insert_notembedded.result:
added
mysql-test/t/bdb_notembedded.test:
***MISSING WEAVE***
mysql-test/t/flush_block_commit_notembedded.test:
added
mysql-test/t/insert_notembedded.test:
added
into lamia.home:/home/timka/mysql/src/5.1-dbg
mysql-test/r/insert_select.result:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
The cause of the bug was an incomplete fix for bug 18080.
The problem was that setup_tables() unconditionally reset the
name resolution context to its 'tables' argument, which pointed
to the first table of an SQL statement.
The bug fix limits resetting of the name resolution context in
setup_tables() only in the cases when the context was not set
by earlier parser/optimizer phases.
mysql-test/r/insert_select.result:
Test for BUG#21774.
mysql-test/t/insert_select.test:
Test for BUG#21774.
sql/sql_base.cc:
Do not reset the name resolution contect unconditionally.
Instead set the context to 'tables' only if it was not
set before calling setup_tables().
sql/sql_insert.cc:
Added asserts to make sure that in the case of INSERT ... VALUES ...
statements it is not necessary to reset the name resolution context
to the first table, because there is only one table in the list of
tables anyway. The actual code is not removed in order not to
confuse it with the actual bug fix.
sql/sql_parse.cc:
Removed unnecessary reset of the name resolution context.
The context is anyway unconditionally reset in mysql_insert()
and mysql_prepare_insert().
into xiphis.org:/home/antony/work2/mysql-5.0-merge
mysql-test/r/create.result:
Auto merged
mysql-test/r/federated.result:
Auto merged
mysql-test/r/insert_select.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/ps_6bdb.result:
Auto merged
mysql-test/r/ps_7ndb.result:
Auto merged
mysql-test/r/strict.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/r/warnings.result:
Auto merged
sql/share/errmsg.txt:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
columns
Fixed confusing warning.
Quoting INSERT section of the manual:
----
Inserting NULL into a column that has been declared NOT NULL. For
multiple-row INSERT statements or INSERT INTO ... SELECT statements, the
column is set to the implicit default value for the column data type. This
is 0 for numeric types, the empty string ('') for string types, and the
"zero" value for date and time types. INSERT INTO ... SELECT statements are
handled the same way as multiple-row inserts because the server does not
examine the result set from the SELECT to see whether it returns a single
row. (For a single-row INSERT, no warning occurs when NULL is inserted into
a NOT NULL column. Instead, the statement fails with an error.)
----
This is also true for LOAD DATA INFILE. For INSERT user can specify
DEFAULT keyword as a value to set column default. There is no similiar
feature available for LOAD DATA INFILE.
mysql-test/r/auto_increment.result:
Fixed confusing warning.
mysql-test/r/create.result:
Fixed confusing warning.
mysql-test/r/insert.result:
Fixed confusing warning.
mysql-test/r/insert_select.result:
Fixed confusing warning.
mysql-test/r/key.result:
Fixed confusing warning.
mysql-test/r/null.result:
Fixed confusing warning.
mysql-test/r/null_key.result:
Fixed confusing warning.
mysql-test/r/ps_2myisam.result:
Fixed confusing warning.
mysql-test/r/ps_3innodb.result:
Fixed confusing warning.
mysql-test/r/ps_4heap.result:
Fixed confusing warning.
mysql-test/r/ps_5merge.result:
Fixed confusing warning.
mysql-test/r/ps_6bdb.result:
Fixed confusing warning.
mysql-test/r/strict.result:
Fixed confusing warning.
mysql-test/r/view.result:
Fixed confusing warning.
mysql-test/r/warnings.result:
Fixed confusing warning.
sql/share/errmsg.txt:
Fixed confusing warning.
REPLACE ... SELECT would require INSERT privileges on certain tables
when SELECT really suffices. Require INSERT only on target table.
mysql-test/r/insert_select.result:
Bug#20989: View '(null).(null)' references invalid table(s)... on SQL SECURITY INVOKER
Show that REPLACE ... SELECT requires INSERT privileges only on target table.
(revised test with more view-fu)
mysql-test/t/insert_select.test:
Bug#20989: View '(null).(null)' references invalid table(s)... on SQL SECURITY INVOKER
Show that REPLACE ... SELECT requires INSERT privileges only on target table.
(revised test with more view-fu)
sql/sql_insert.cc:
Bug#20989: View '(null).(null)' references invalid table(s)... on SQL SECURITY INVOKER
require SELECT rather than INSERT privs on tables that constitute the views we'll read
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/r/insert_select.result:
Auto merged
mysql-test/r/key.result:
Auto merged
mysql-test/r/view_grant.result:
Auto merged
mysql-test/t/key.test:
Auto merged
mysql-test/t/view_grant.test:
Auto merged
sql/field.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
into mysql.com:/home/emurphy/src/bk-clean/mysql-5.1
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/valgrind.supp:
Auto merged
mysql-test/r/func_str.result:
Auto merged
mysql-test/r/insert_select.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/myisam.test:
Auto merged
mysql-test/t/select.test:
Auto merged
mysys/Makefile.am:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/opt_sum.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_select.cc:
Auto merged
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
Auto merged
storage/ndb/src/ndbapi/ndberror.c:
Auto merged
include/Makefile.am:
manual merge
mysql-test/r/func_time.result:
manual merge
mysql-test/r/select.result:
manual merge
There was an incomplete reset of the name resolution context, that caused
INSERT ... SELECT ... JOIN statements to resolve not by joint row type calculated
for the join.
Removed the redundant re-initialization of the context, because
mysql_insert_select_prepare() now correctly saves/restores the context.
mysql-test/r/insert_select.result:
Bug #18080: INSERT ... SELECT ... JOIN results in ambiguous field list error
- testsuite for the bug
mysql-test/t/insert_select.test:
Bug #18080: INSERT ... SELECT ... JOIN results in ambiguous field list error
- testsuite for the bug
sql/sql_parse.cc:
Bug #18080: INSERT ... SELECT ... JOIN results in ambiguous field list error
- remove an incomplete reset of the context because the mentioned function
correctly saves/restores the context.
into mysql.com:/home/kgeorge/mysql/5.0/B9676
mysql-test/r/insert_select.result:
Auto merged
mysql-test/t/insert_select.test:
Auto merged
sql/sql_select.cc:
SCCS merged
tables
Currently in INSERT ... SELECT ... LIMIT ... the compiler uses a
temporary table to store the results of SELECT ... LIMIT .. and then
uses that table as a source for INSERT. The problem is that in some cases
it actually skips the LIMIT clause in doing that and materializes the
whole SELECT result set regardless of the LIMIT.
This fix is limiting the process of filling up the temp table with only
that much rows that will be actually used by propagating the LIMIT value.
mysql-test/r/insert_select.result:
* Bug #9676: INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big
tables
- a test demonstrating the code path
mysql-test/t/insert_select.test:
* Bug #9676: INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big
tables
- a test demonstrating the code path
sql/sql_select.cc:
* Bug #9676: INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big
tables
- pass through the real LIMIT number if the temp table is created for
buffering results.
- set the counter for all the cases when the temp table is not used for
grouping
SQL mode TRADITIONAL
Message is chenged from 'ER_WARN_NULL_TO_NOTNULL' to 'ER_BAD_NULL_ERROR'
mysql-test/r/auto_increment.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/create.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/insert.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/insert_select.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/key.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/null.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/null_key.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/ps_2myisam.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/ps_3innodb.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/ps_4heap.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/ps_5merge.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/ps_6bdb.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/ps_7ndb.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/strict.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/view.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/r/warnings.result:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
result change
mysql-test/t/strict.test:
Fix for bug#11491 Misleading error message if not NULL column set to NULL,
SQL mode TRADITIONAL
test change
mysql-test/r/insert_select.result:
Merge from 4.1 to 5.0.
mysql-test/r/select.result:
Merge from 4.1 to 5.0.
mysql-test/t/insert_select.test:
Merge from 4.1 to 5.0.
mysys/my_handler.c:
Merge from 4.1 to 5.0.
sql/item.cc:
Merge from 4.1 to 5.0.
sql/item_timefunc.cc:
Imported bug fix from 4.1 to 5.0. (Bug#14016)
sql/item_timefunc.h:
Imported bug fix from 4.1 to 5.0. (Bug#14016)