SELECT right instead of INSERT right was required for an insert into to a view.
This wrong behaviour appeared after the fix for bug #20989. Its intention was
to ask only SELECT right for all tables except the very first for a complex
INSERT query. But that patch has done it in a wrong way and lead to asking
a wrong access right for an insert into a view.
The setup_tables_and_check_access() function now accepts two want_access
parameters. One will be used for the first table and the second for other
tables.
mysql-test/t/view.test:
Added a test case for bug#21261: Wrong access rights was required for an insert into a view
mysql-test/r/view.result:
Added a test case for bug#21261: Wrong access rights was required for an insert into a view
sql/sql_update.cc:
Fixed bug#21261: Wrong access rights was required for an insert into a view
Modified to use updated setup_tables_and_check_access() function.
sql/sql_select.cc:
Fixed bug#21261: Wrong access rights was required for an insert into a view
Modified to use updated setup_tables_and_check_access() function.
sql/sql_load.cc:
Fixed bug#21261: Wrong access rights was required for an insert into a view
Modified to use updated setup_tables_and_check_access() function.
sql/sql_insert.cc:
Fixed bug#21261: Wrong access rights was required for an insert into a view
Modified to use updated setup_tables_and_check_access() function.
sql/sql_delete.cc:
Fixed bug#21261: Wrong access rights was required for an insert into a view
Modified to use updated setup_tables_and_check_access() function.
sql/sql_base.cc:
Fixed bug#21261: Wrong access rights was required for an insert into a view
The setup_tables_and_check_access() function now accepts two want_access
parameters. One will be used for the first table and the second for other
tables.
sql/mysql_priv.h:
Fixed bug#21261: Wrong access rights was required for an insert into a view
The setup_tables_and_check_access() function now accepts two want_access
parameters.
into bodhi.local:/opt/local/work/mysql-5.0-runtime
sql/ha_ndbcluster.cc:
Auto merged
sql/item.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/sql_update.cc:
Manual merge.
NDB table".
SQL-layer was not marking fields which were used in triggers as such. As
result these fields were not always properly retrieved/stored by handler
layer. So one might got wrong values or lost changes in triggers for NDB,
Federated and possibly InnoDB tables.
This fix solves the problem by marking fields used in triggers
appropriately.
Also this patch contains the following cleanup of ha_ndbcluster code:
We no longer rely on reading LEX::sql_command value in handler in order
to determine if we can enable optimization which allows us to handle REPLACE
statement in more efficient way by doing replaces directly in write_row()
method without reporting error to SQL-layer.
Instead we rely on SQL-layer informing us whether this optimization
applicable by calling handler::extra() method with
HA_EXTRA_WRITE_CAN_REPLACE flag.
As result we no longer apply this optimzation in cases when it should not
be used (e.g. if we have on delete triggers on table) and use in some
additional cases when it is applicable (e.g. for LOAD DATA REPLACE).
Finally this patch includes fix for bug#20728 "REPLACE does not work
correctly for NDB table with PK and unique index".
This was yet another problem which was caused by improper field mark-up.
During row replacement fields which weren't explicity used in REPLACE
statement were not marked as fields to be saved (updated) so they have
retained values from old row version. The fix is to mark all table
fields as set for REPLACE statement. Note that in 5.1 we already solve
this problem by notifying handler that it should save values from all
fields only in case when real replacement happens.
include/my_base.h:
Added HA_EXTRA_WRITE_CAN_REPLACE, HA_EXTRA_WRITE_CANNOT_REPLACE - new
parameters for ha_extra() method. We use them to inform handler that
write_row() which tries to insert new row into the table and encounters
some already existing row with same primary/unique key can replace old
row with new row instead of reporting error.
mysql-test/r/federated.result:
Additional test for bug#18437 "Wrong values inserted with a before update
trigger on NDB table".
mysql-test/r/ndb_replace.result:
Added test for bug #20728 "REPLACE does not work correctly for NDB table
with PK and unique index". Updated wrong results from older test.
mysql-test/t/federated.test:
Additional test for bug#18437 "Wrong values inserted with a before update
trigger on NDB table".
mysql-test/t/ndb_replace.test:
Added test for bug #20728 "REPLACE does not work correctly for NDB table
with PK and unique index".
sql/ha_ndbcluster.cc:
We no longer rely on reading LEX::sql_command value in handler in order
to determine if we can enable optimization which allows us to handle REPLACE
statement in more efficient way by doing replaces directly in write_row()
method without reporting error to SQL-layer.
Instead we rely on SQL-layer informing us whether this optimization
applicable by calling handler::extra() method with
HA_EXTRA_WRITE_CAN_REPLACE flag.
As result we no longer apply this optimization in cases when it should not
be used (e.g. if we have on delete triggers on table) and use in some
additional cases when it is applicable (e.g. for LOAD DATA REPLACE).
sql/item.cc:
Item_trigger_field::setup_field():
Added comment explaining why we don't set Field::query_id in this method.
sql/mysql_priv.h:
mysql_alter_table() function no longer takes handle_duplicates argument.
Added declaration of mark_fields_used_by_triggers_for_insert_stmt() function.
sql/sql_delete.cc:
Mark fields which are used by ON DELETE triggers so handler will retrieve
values for these fields.
sql/sql_insert.cc:
Explicitly inform handler that we are doing REPLACE (using ha_extra() method)
in cases when it can promote insert operation done by write_row() to replace.
Also when we do REPLACE we want to store values for all columns so we should
inform handler about it.
Finally we should mark fields used by ON UPDATE/ON DELETE triggers as such
so handler can properly retrieve/restore values in these fields during
execution of REPLACE and INSERT ... ON DUPLICATE KEY UPDATE statements.
sql/sql_load.cc:
Explicitly inform handler that we are doing LOAD DATA REPLACE (using
ha_extra() method) in cases when it can promote insert operation done by
write_row() to replace.
Also when we do replace we want to save (replace) values for all columns
so we should inform handler about it.
Finally to properly execute LOAD DATA for table with triggers we should
mark fields used by ON INSERT triggers as such so handler can properly
store values for these fields.
sql/sql_parse.cc:
mysql_alter_table() function no longer takes handle_duplicates argument.
sql/sql_table.cc:
Got rid of handle_duplicates argument in mysql_alter_table() and
copy_data_between_tables() functions. These functions were always
called with handle_duplicates == DUP_ERROR and thus contained dead
(and probably incorrect) code.
sql/sql_trigger.cc:
Added Table_triggers_list::mark_fields_used() method which is used to mark
fields read/set by triggers as such so handlers will be able properly
retrieve/store values in these fields.
sql/sql_trigger.h:
Table_triggers_list:
Added mark_fields_used() method which is used to mark fields read/set by
triggers as such so handlers will be able properly retrieve/store values
in these fields. To implement this method added 'trigger_fields' member
which is array of lists linking items for all fields used in triggers
grouped by event and action time.
sql/sql_update.cc:
Mark fields which are used by ON UPDATE triggers so handler will retrieve
and save values for these fields.
mysql-test/r/ndb_trigger.result:
Added test for bug#18437 "Wrong values inserted with a before update trigger
on NDB table".
mysql-test/t/ndb_trigger.test:
Added test for bug#18437 "Wrong values inserted with a before update trigger
on NDB table".
BUG#18036 - update of table joined to self reports table as crashed
Set exclude_from_table_unique_test value back to FALSE. It is needed for
further check in multi_update::prepare whether to use record cache.
sql/sql_update.cc:
Set exclude_from_table_unique_test value back to FALSE. It is needed for
further check in multi_update::prepare whether to use record cache.
Certain updates of table joined to self results in unexpected
behavior.
The problem was that record cache was mistakenly enabled for
self-joined table updates. Normally record cache must be disabled
for such updates.
Fixed wrong condition in code that determines whether to use
record cache for self-joined table updates.
Only MyISAM tables were affected.
mysql-test/r/myisam.result:
Test case for BUG#18036.
mysql-test/t/myisam.test:
Test case for BUG#18036.
sql/sql_update.cc:
Fixed wrong condition in code that determines whether to use
record cache for self-joined table updates.
The check for view security was lacking several points :
1. Check with the right set of permissions : for each table ref that
participates in a view there were the right credentials to use in it's
security_ctx member, but these weren't used for checking the credentials.
This makes hard enforcing the SQL SECURITY DEFINER|INVOKER property
consistently.
2. Because of the above the security checking for views was just ruled out
in explicit ways in several places.
3. The security was checked only for the columns of the tables that are
brought into the query from a view. So if there is no column reference
outside of the view definition it was not detecting the lack of access to
the tables in the view in SQL SECURITY INVOKER mode.
The fix below tries to fix the above 3 points.
mysql-test/r/grant.result:
removed nondeterminism (unspecified order) in some test output
mysql-test/r/view_grant.result:
Somewhat extended test case for the bug and similar queries.
mysql-test/t/grant.test:
removed nondeterminism (unspecified order) in some test output
mysql-test/t/view_grant.test:
Somewhat extended test case for the bug and similar queries.
sql/mysql_priv.h:
A wrapper for setup_tables that also checks access to the tables
sql/sql_acl.cc:
removed artificial security check stop and used the table ref's credentials.
sql/sql_base.cc:
a wrapper for setup_tables to check access to the tables
sql/sql_delete.cc:
wrapper called.
sql/sql_insert.cc:
wrapper called
sql/sql_load.cc:
wrapper called
sql/sql_parse.cc:
wrapper called and artificial check stop removed
sql/sql_select.cc:
wrapper called
sql/sql_update.cc:
wrapper called
sql/table.cc:
Mask table access to the view error as well.
Mutli-table uses temporary table to store new values for fields. With the
new values the rowid of the record to be updated is stored in a Field_string
field. Table to be updated is set as source table of the rowid field.
But when the temporary table creates the tmp field for the rowid field it
converts it to a varstring field because the table to be updated was created by
the v4.1. Due to this the stored rowids were broken and no records for
update were found.
The flag can_alter_field_type is added to Field_string class. When it is set to
0 the field won't be converted to varstring. The Field_string::type() function
now always returns MYSQL_TYPE_STRING if can_alter_field_type is set to 0.
The multi_update::initialize_tables() function now sets can_alter_field_type
flag to 0 for the rowid fields denying conversion of the field to a varstring
field.
sql/field.h:
Fixed bug #16281: Multi-table update broken in 5.0 on tables imported from 4.1
The flag can_alter_field_type is added to Field_string class. When it is set to
0 the field won't be converted to varstring.
The Field_string::type() function now always returns MYSQL_TYPE_STRING if
can_alter_field_type is set to 0.
sql/sql_update.cc:
Fixed bug #16281: Multi-table update broken in 5.0 on tables imported from 4.1
The multi_update::initialize_tables() function now sets can_alter_field_type
flag to 0 for the rowid fields denying conversion of the field to a varstring
field.
- Added empty constructors and virtual destructors to many classes and structs
- Removed some usage of the offsetof() macro to instead use C++ class pointers
configure.in:
Added comment
ndb/include/ndbapi/NdbDictionary.hpp:
Fixed compiler warnings from gcc 4.0.2
sql/field.cc:
Fixed compiler warnings from gcc 4.0.2
sql/handler.h:
Fixed compiler warnings from gcc 4.0.2
sql/item.h:
Fixed compiler warnings from gcc 4.0.2
sql/item_cmpfunc.h:
Fixed compiler warnings from gcc 4.0.2
sql/log_event.h:
Fixed compiler warnings from gcc 4.0.2
sql/mysql_priv.h:
Fixed compiler warnings from gcc 4.0.2
For find_table_in_list I fixed it to use proper C++ class pointers instead of C style pointers
sql/opt_range.cc:
Fixed compiler warnings from gcc 4.0.2
sql/parse_file.h:
Fixed compiler warnings from gcc 4.0.2
sql/sp_rcontext.h:
Fixed compiler warnings from gcc 4.0.2
sql/spatial.h:
Fixed compiler warnings from gcc 4.0.2
sql/sql_base.cc:
Fixed compiler warnings from gcc 4.0.2
sql/sql_cache.h:
Fixed compiler warnings from gcc 4.0.2
sql/sql_class.h:
Fixed compiler warnings from gcc 4.0.2
sql/sql_parse.cc:
Fixed compiler warnings from gcc 4.0.2
(Not pretty, but seams to work...)
sql/sql_select.h:
Fixed compiler warnings from gcc 4.0.2
sql/sql_update.cc:
Fixed compiler warnings from gcc 4.0.2
sql/table.h:
Fixed compiler warnings from gcc 4.0.2
sql/tztime.cc:
Fixed compiler warnings from gcc 4.0.2
sql/tztime.h:
Fixed compiler warnings from gcc 4.0.2
trigger starts trigger".
In short, the deadlock/crash happened when execution of statement, which used
stored functions or activated triggers, coincided with alteration of the
tables used by these functions or triggers (in highly concurrent environment).
Bug was caused by the incorrect handling of tables from prelocked set in
open_tables() functions in situations when refresh happened. This fix replaces
old smart but not very robust way of handling tables after refresh (which was
closing only old tables), with new one which simply closes all tables opened so
far and restarts open_tables().
Also fixed handling of temporary tables in close_tables_for_reopen().
No test case present since bug manifests itself only in concurrent environment.
sql/mysql_priv.h:
In order to handle correctly case when table list completely consists from tables
from prelocked set close_tables_for_reopen() have to accept table list as in/out
parameter.
sql/sql_base.cc:
open_tables():
Removed part of comment which was out of date.
Changed handling of case when refresh happens during opening of tables, now
instead of having code which decides for each table if it should be closed
we simply close all tables. Old code also incorrectly handled tables from
prelocked set in this situation which resulted in bug #16593 "Deadlock or
crash in stress test for case where triggers starting trigger".
close_tables_for_reopen():
Now we correctly handle the case when table list completely consists from
tables from prelocked set. Also now we simply close all tables instead
leaving temporary tables non-closed (such approach allows easily handle
correctly tables from prelocked set).
sql/sql_prepare.cc:
In order to handle correctly case when table list completely consists from tables
from prelocked set close_tables_for_reopen() have to accept table list as in/out
parameter.
sql/sql_update.cc:
In order to handle correctly case when table list completely consists from tables
from prelocked set close_tables_for_reopen() have to accept table list as in/out
parameter.
mysql-test/r/update.result:
Testcase for BUG#15935
mysql-test/t/update.test:
Testcase for BUG#15935
sql/sql_update.cc:
BUG#15935:
- Do account for the fact that used_index!=MAX_KEY is also true for cases
when quick select is used, and use quick select then (and not full index scan).
- Also removed the redundant "used_index= MAX_KEY" statement
into mysql.com:/home/mydev/mysql-5.0-bug5390
BitKeeper/deleted/.del-ha_blackhole.cc~727c69ef7846623a:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_update.cc:
Auto merged
Problem #1: INSERT...SELECT, Version for 5.0.
Extended the unique table check by a check of lock data.
Merge sub-tables cannot be detected by doing name checks only.
mysql-test/r/create.result:
BUG#5390 - problems with merge tables
Removed a duplicate test.
mysql-test/r/merge.result:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT
Added test results.
mysql-test/t/create.test:
BUG#5390 - problems with merge tables
Removed a duplicate test.
mysql-test/t/merge.test:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT
Added tests.
sql/lock.cc:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 5.0.
Added a new function to find a duplicate lock in a list of tables.
sql/mysql_priv.h:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 5.0.
Added the thread handle to unique_table().
Added a declaration for the new function.
sql/sql_base.cc:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 5.0.
Added the thread handle to unique_table().
Added a call to the new mysql_lock_have_duplicate(),
which needs the thread handle, to unique_table().
sql/sql_delete.cc:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 5.0.
Added the thread handle to unique_table().
sql/sql_insert.cc:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 5.0.
Added the thread handle to unique_table().
sql/sql_load.cc:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 5.0.
Added the thread handle to unique_table().
sql/sql_parse.cc:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 5.0.
Added the thread handle to unique_table().
sql/sql_update.cc:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 5.0.
Added the thread handle to unique_table().
Replaced a call to find_table_in_local_list() by
the newly extended unique_table().
handling so that indexes are closed before trying to commit the
transaction. (Bug #15536)
mysql-test/r/bdb.result:
Add new results
mysql-test/t/bdb.test:
Add new test
sql/sql_delete.cc:
Move call to free_underlaid_joins() to before ha_autocommit_or_rollback().
sql/sql_insert.cc:
Move call to free_underlaid_joins() to before ha_autocommit_or_rollback().
sql/sql_update.cc:
Move call to free_underlaid_joins() to before ha_autocommit_or_rollback().
Problem #1: INSERT...SELECT, Version for 4.1.
INSERT ... SELECT with the same table on both sides (hidden
below a MERGE table) does now work by buffering the select result.
The duplicate detection works now after open_and_lock_tables()
on the locks.
I did not find a test case that failed without the change in
sql_update.cc. I made the change anyway as it should in theory
fix a possible MERGE table problem with multi-table update.
libmysqld/ha_blackhole.cc:
BUG#5390 - problems with merge tables
No idea, how the symlink change made it into my patch.
mysql-test/r/create.result:
BUG#5390 - problems with merge tables
Removed a duplicate test.
mysql-test/r/merge.result:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 4.1.
Added test results.
mysql-test/t/create.test:
BUG#5390 - problems with merge tables
Removed a duplicate test.
mysql-test/t/merge.test:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 4.1.
Added tests.
sql/lock.cc:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 4.1.
Added a new function to find a duplicate lock in a list of tables.
sql/mysql_priv.h:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 4.1.
Added a declaration for the new function.
sql/sql_parse.cc:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 4.1.
Changed the duplicate tables detection for INSERT ... SELECT
to use the new function, which does also work for MERGE tables.
sql/sql_update.cc:
BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 4.1.
Changed the duplicate tables detection for UPDATE
to use the new function, which does also work for MERGE tables.
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_sum.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/update.result:
Auto merged
mysql-test/t/update.test:
Auto merged
ndb/src/kernel/blocks/backup/Backup.cpp:
Auto merged
sql/sql_update.cc:
Auto merged
depending on table order
multi_update::send_data() was counting updates, not updated rows. Thus if one
record have several updates it will be counted several times in 'rows matched'
but updated only once.
multi_update::send_data() now counts only unique rows.
sql/sql_update.cc:
Fix bug#15028 Multitable update returns different numbers of matched rows
depending on table order
multi_update::send_data() now counts only unique rows.
mysql-test/t/update.test:
Test case for bug#15028 Multitable update returns different numbers of matched rows depending on table order
mysql-test/r/update.result:
Test case for bug#15028 Multitable update returns different numbers of matched rows depending on table order
Don't set thd->is_fatal_error in sql_update for duplicate key errors.
mysql-test/r/sp.result:
New test case for BUG#13729.
mysql-test/r/sp_trans.result:
New test case for BUG#14840.
mysql-test/t/sp.test:
New test case for BUG#13729.
mysql-test/t/sp_trans.test:
New test case for BUG#14840.
sql/sql_update.cc:
Don't set thd->is_fatal_error if it's a duplicate key error.
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
mysql-test/r/func_gconcat.result:
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_sum.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_update.cc:
Auto merged
Optimize new pushed code
sql/item_func.cc:
Fixed wrong merge
sql/sql_update.cc:
Optimize new pushed code
(There is no reason to add extra test for not common error case if code can handle it anyway)
client/mysqltest.c:
Auto merged
myisam/mi_check.c:
Auto merged
mysql-test/r/update.result:
Auto merged
mysql-test/t/update.test:
Auto merged
sql/item_timefunc.h:
Auto merged
sql/spatial.cc:
Auto merged
sql/sql_select.h:
Auto merged
BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003:
Auto merged
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Date field was declared as not null, thus expression 'datefield is null'
was always false. For SELECT special handling of such cases is used.
There 'datefield is null' converted to 'datefield eq "0000-00-00"'.
In mysql_update() before creation of select added remove_eq_conds() call.
It makes some optimization of conds and in particular performs conversion
from 'is null' to 'eq'.
Also remove_eq_conds() makes some evaluation of conds and if it founds that
conds is always false then update statement is not processed further.
All this allows to perform some update statements process faster due to
optimized conds, and not wasting resources if conds known to be false.
sql/sql_select.cc:
Fix bug#14186 select datefield is null not updated
Remove static from remove_eq_conds()
sql/sql_select.h:
Fix bug#14186 select datefield is null not updated
Added remove_eq_conds() prototype.
mysql-test/r/update.result:
Test case for bug#14186 select datefield is null not updated
mysql-test/t/update.test:
Test case for bug#14186 select datefield is null not updated
sql/sql_update.cc:
Fix bug#14186 select datefield is null not updated
To mysql_update() added call to remove_eq_conds() to optimize conds and convert 'datefield is null' to 'datefield eq 0000-00-00'
mysql-test/r/information_schema.result:
error message changed
mysql-test/r/sp.result:
error message changed
mysql-test/r/sql_mode.result:
fixed test suite
mysql-test/r/view.result:
error message changed
mysql-test/r/view_grant.result:
test of underlying view tables check
mysql-test/t/sql_mode.test:
fixed test suite
mysql-test/t/view_grant.test:
test of underlying view tables check
sql/item.cc:
check of underlying tables privilege added
sql/item.h:
Name the resolution context points to the security context of view (if item belong to the view)
sql/item_func.cc:
a view error hiding for execution of prepared function belonged to a view
fixed checking privileges if stored functions belonds to some view
sql/mysql_priv.h:
refult of derived table processing functions changed to bool
Security_context added as an argument to find_field_in_table()
sql/share/errmsg.txt:
error message fixed
sql/sql_acl.cc:
Storing requested privileges of tables added
View underlying tables privilege check added
sql/sql_base.cc:
View underlying tables privilege check added
sql/sql_cache.cc:
Code cleunup: we should not register underlying tables of view second time
sql/sql_delete.cc:
ancestor -> merge_underlying_list renaming
sql/sql_derived.cc:
refult of derived table processing functions changed to bool
do not give SELECT_ACL for TEMPTABLE views
sql/sql_lex.h:
The comment added
sql/sql_parse.cc:
registration of requested privileges added
sql/sql_prepare.cc:
registration of requested privileges added
sql/sql_update.cc:
manipulation of requested privileges for underlying tables made the same as for table which we are updating
sql/sql_view.cc:
underlying tables of view security check support added
sql/table.cc:
renaming and fixing view preparation methods, methods for checking underlyoing tables security context added
sql/table.h:
storege for reuested privileges added
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-tmp
heap/_check.c:
Auto merged
heap/hp_create.c:
Auto merged
include/config-netware.h:
Auto merged
include/my_base.h:
Auto merged
include/my_handler.h:
Auto merged
include/myisam.h:
Auto merged
innobase/include/Makefile.am:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_delete.c:
Auto merged
myisam/mi_rnext_same.c:
Auto merged
myisam/mi_search.c:
Auto merged
myisam/mi_write.c:
Auto merged
myisam/myisamdef.h:
Auto merged
myisam/sort.c:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/r/update.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
mysql-test/t/select.test:
Auto merged
mysql-test/t/update.test:
Auto merged
mysys/my_getopt.c:
Auto merged
mysys/my_handler.c:
Auto merged
scripts/make_binary_distribution.sh:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/records.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/structs.h:
Auto merged
strings/conf_to_src.c:
Auto merged
strings/ctype-win1250ch.c:
Auto merged
Makefile.am:
Merged from 4.1
myisam/myisamchk.c:
Merged from 4.1
mysql-test/mysql-test-run.pl:
Merged from 4.1
mysql-test/r/insert_select.result:
Merged from 4.1
mysql-test/r/myisam.result:
Merged from 4.1
mysql-test/r/select.result:
Merged from 4.1
mysql-test/t/insert_select.test:
Merged from 4.1
mysql-test/t/myisam.test:
Merged from 4.1
netware/mysql_test_run.c:
Merged from 4.1
sql/item.cc:
Merged from 4.1
sql/mysqld.cc:
Merged from 4.1
sql/sql_update.cc:
Merged from 4.1
tests/mysql_client_test.c:
Merged from 4.1
This could cause failures because there are table handlers (like federated)
that support quick select scanning but do not support index scanning.
mysql-test/t/disabled.def:
Enabled federated testcase.
heap/_check.c:
Change arguments to ha_key_cmp
heap/hp_create.c:
Change arguments to ha_key_cmp
include/my_base.h:
Remove SEARCH_RETURN_B_POS and instead always send an array to ha_key_cmp() as last argument
myisam/mi_check.c:
Change arguments to ha_key_cmp
myisam/mi_rnext_same.c:
Change arguments to ha_key_cmp
myisam/mi_search.c:
Change arguments to ha_key_cmp
myisam/mi_write.c:
Change arguments to ha_key_cmp
myisammrg/myrg_queue.c:
Change arguments to ha_key_cmp
mysys/my_handler.c:
Remove SEARCH_RETURN_B_POS and instead always send an array to ha_key_cmp() as last argument
(This removes an if in a loop at the expensive of an int on the stack)
sql/records.cc:
Simplify new rr_index() code
Create common error handling function for rr_() functions.
Remove loop from rr_index() as handler::index_next() can never return HA_ERR_RECORD_DELETED
sql/sql_load.cc:
Simplify
sql/sql_update.cc:
Simplify code
Fixed bug when one is updating an index column that could be used with ORDER BY
sql/structs.h:
Removed not needed structure element
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/update.result:
Auto merged
mysql-test/t/update.test:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/records.cc:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/structs.h:
Auto merged
allowed set functions aggregated in outer subqueries, allowed nested set functions.
mysql-test/r/func_gconcat.result:
Changed a query when fixing bug #12762.
mysql-test/r/subselect.result:
Added test cases for bug #12762.
Allowed set functions aggregated in outer subqueries. Allowed nested set functions.
mysql-test/t/func_gconcat.test:
Changed a query when fixing bug #12762.
mysql-test/t/subselect.test:
Added test cases for bug #12762.
Allowed set functions aggregated in outer subqueries. Allowed nested set functions.
sql/item.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
aggregated in outer subquries.
Changed Item_field::fix_fields to calculate attributes used when checking context conditions
for set functions.
Allowed alliases for set functions defined in outer subqueries.
sql/item.h:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
aggregated in outer subquries.
sql/item_cmpfunc.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
aggregated in outer subquries.
sql/item_func.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
aggregated in outer subquries.
sql/item_row.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
aggregated in outer subquries.
sql/item_strfunc.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
aggregated in outer subquries.
sql/item_subselect.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced next levels for subqueries and a bitmap of nesting levels showing
in what subqueries a set function can be aggregated.
sql/item_sum.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Added Item_sum methods to check context conditions imposed on set functions.
sql/item_sum.h:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Added Item_sum methods to check context conditions imposed on set functions.
sql/mysql_priv.h:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced a type of bitmaps to be used for nesting constructs.
sql/sql_base.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced next levels for subqueries and a bitmap of nesting levels showing
in what subqueries a set function can be aggregated.
sql/sql_class.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
sql/sql_class.h:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
sql/sql_delete.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
sql/sql_lex.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced next levels for subqueries and a bitmap of nesting levels showing
in what subqueries a set function can be aggregated.
sql/sql_lex.h:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced next levels for subqueries and a bitmap of nesting levels showing
in what subqueries a set function can be aggregated.
sql/sql_parse.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced next levels for subqueries.
sql/sql_prepare.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced a bitmap of nesting levels showingin what subqueries a set function can be aggregated.
sql/sql_select.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced next levels for subqueries and a bitmap of nesting levels showing
in what subqueries a set function can be aggregated.
sql/sql_update.cc:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
sql/sql_yacc.yy:
Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
Introduced next levels for subqueries.
- fixed test
mysql-test/r/rpl_multi_update2.result:
fixed setting/reseting environment
multi-update with subquery added
mysql-test/t/rpl_multi_update2.test:
fixed setting/reseting environment
multi-update with subquery added
sql/sql_update.cc:
set 'updating' in both tables list if we have two of them (because of subquery)
into mysql.com:/users/lthalmann/bk/mysql-5.0
myisam/mi_rkey.c:
Auto merged
mysql-test/r/subselect2.result:
Auto merged
mysql-test/t/select.test:
Auto merged
ndb/src/mgmsrv/InitConfigFileParser.cpp:
Auto merged
scripts/make_binary_distribution.sh:
Auto merged
configure.in:
After merge fixes
myisam/mi_search.c:
After merge fixes
mysql-test/r/select.result:
After merge fixes
sql/item.cc:
After merge fixes
sql/sql_parse.cc:
After merge fixes
sql/sql_update.cc:
After merge fixes
mysql-test/r/rpl_multi_update3.result:
New test case
mysql-test/t/rpl_multi_update3.test:
New test case
sql/sql_parse.cc:
Removed fake locking
Changed so that filtering is done later for multi-update
Removed redundant code
sql/sql_update.cc:
Moved call to sql_parse.cc
optimization: now can use index to find records to update/delete
when there is no WHERE clause.
mysql-test/r/update.result:
Testcase for BUG#12915
mysql-test/t/update.test:
Testcase for BUG#12915
sql/mysql_priv.h:
BUG#12915: Added init_read_record_idx function.
sql/opt_range.cc:
BUG#12915: Added get_index_for_order() - find an index that can be
used to get first N table records in given ordering cheaper then
one would with full table scan.
sql/opt_range.h:
BUG#12915: Added get_index_for_order() function
sql/records.cc:
BUG#12915: Added init_read_record_idx(), rr_index() that allow to scan
index using init_read_record()/read_record.read_record()
sql/sql_delete.cc:
BUG#12915: Added single-table DELETE ... ORDER BY ... LIMIT optimization:
now can use index to find records to delete when there is no WHERE clause.
sql/sql_update.cc:
BUG#12915: Added single-table UPDATE ... ORDER BY ... LIMIT optimization:
now can use index to find records to update when there is no WHERE clause.
sql/structs.h:
BUG#12915: Added init_read_record_idx(), rr_index() that allow to scan
index using init_read_record()/READ_RECORD::read_record()
client/mysql.cc:
Don't use c_ptr() for cgets() and ensure buffer is not overwritten
mysql-test/r/cast.result:
More test for CAST(0x.... as signed)
sql/opt_sum.cc:
Fix bugs found during review
- Changed code to be able to remove one if
- Ensure that count == 0 only if is_exact_count == TRUE
sql/sql_delete.cc:
Ensure 'allow_sum_func' is reset before call to setup_conds
sql/sql_lex.cc:
allow_sum_func doesn't have to be reset for each query
(It's to be reset in setup_fields() or before call to setup_conds()
sql/sql_load.cc:
Move set of auto_increment_field_not_null so that it's not set if field value is NULL
sql/sql_prepare.cc:
allow_sum_func doesn't have to be reset for each query
(It's to be reset in setup_fields() or before call to setup_conds()
sql/sql_update.cc:
Ensure 'allow_sum_func' is reset before call to setup_conds
Not fixed in 4.1 as not critical. Also I'm correcting error checking of multi-UPDATE/DELETE
when it comes to binlogging, to make it consistent with when we rollback the statement.
mysql-test/r/rpl_multi_delete.result:
result update
mysql-test/r/rpl_multi_update.result:
result update
mysql-test/t/rpl_multi_delete.test:
test for BUG#13348
mysql-test/t/rpl_multi_update.test:
test of BUG#13348
sql/sql_delete.cc:
We now binlog multi-DELETE even if no row was updated (like we do for DELETE).
I'm also correcting some error checking (< instead of <=), basing myself on when we rollback.
sql/sql_update.cc:
we now binlog multi-UPDATE even if no row was updated (like we do for UPDATE).
Adding to existing tests to test new behaviour.
I'm also correcting some error checking (< instead of <=), basing myself on when we rollback.
into mysql.com:/home/dlenev/src/mysql-5.0-bg12704-2
sql/mysql_priv.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_update.cc:
Auto merged