The INSERT DELAYED should not maintain its own private auto-increment
counter, because this is assuming that other threads cannot insert
into the table while the INSERT DELAYED thread is inserting, which is
a wrong assumption.
So the start of processing of a batch of INSERT rows in the
INSERT DELAYED thread must be treated as a start of a new statement
and cached next_insert_id must be cleared.
mysql-test/r/delayed.result:
test suite for the bug
mysql-test/t/delayed.test:
test suite for the bug
sql/sql_insert.cc:
Reset auto-increment cacheing before processing
the next batch of inserts in the handler thread
can lead to a wrong result.
All date/time functions has the STRING result type thus their results are
compared as strings. The string date representation allows a user to skip
some of leading zeros. This can lead to wrong comparison result if a date/time
function result is compared to such a string constant.
The idea behind this bug fix is to compare results of date/time functions
and data/time constants as ints, because that date/time representation is
more exact. To achieve this the agg_cmp_type() is changed to take in the
account that a date/time field or an date/time item should be compared
as ints.
This bug fix is partially back ported from 5.0.
The agg_cmp_type() function now accepts THD as one of parameters.
In addition, it now checks if a date/time field/function is present in the
list. If so, it tries to coerce all constants to INT to make date/time
comparison return correct result. The field for the constant coercion is
taken from the Item_field or constructed from the Item_func. In latter case
the constructed field will be freed after conversion of all constant items.
Otherwise the result is same as before - aggregated with help of the
item_cmp_type() function.
From the Item_func_between::fix_length_and_dec() function removed the part
which was converting date/time constants to int if possible. Now this is
done by the agg_cmp_type() function.
The new function result_as_longlong() is added to the Item class.
It indicates that the item is a date/time item and result of it can be
compared as int. Such items are date/time fields/functions.
Correct val_int() methods are implemented for classes Item_date_typecast,
Item_func_makedate, Item_time_typecast, Item_datetime_typecast. All these
classes are derived from Item_str_func and Item_str_func::val_int() converts
its string value to int without regard to the date/time type of these items.
Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func()
functions are changed to substitute result type of an item with the INT_RESULT
if the item is a date/time item and another item is a constant. This is done
to get a correct result of comparisons like date_time_function() = string_constant.
mysql-test/r/cast.result:
Fixed wrong test case result after bug fix#16377.
sql/item_timefunc.h:
Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.
The result_as_longlong() function is set to return TRUE for these classes:
Item_date, Item_date_func, Item_func_curtime, Item_func_sec_to_time,
Item_date_typecast, Item_time_typecast, Item_datetime_typecast,
Item_func_makedate.
sql/item_timefunc.cc:
Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.Correct val_int() methods are implemented for classes Item_date_typecast,
Item_func_makedate, Item_time_typecast, Item_datetime_typecast.
sql/item_cmpfunc.h:
Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.
Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func()
functions are changed to substitute result type of an item with the INT_RESULT
if the item is a date/time item and another item is a constant.
sql/field.cc:
Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.
Field::set_warning(), Field::set_datetime_warning() now use current_thd to get thd if table isn't set.
sql/item_cmpfunc.cc:
Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.
The agg_cmp_type() function now accepts THD as one of parameters.
In addition, it now checks if a date/time field/function is present in the
list. If so, it tries to coerce all constants to INT to make date/time
comparison return correct result. The field for the constant coercion is
taken from the Item_field or constructed from the Item_func. In latter case
the constructed field will be freed after conversion of all constant items.
Otherwise the result is same as before - aggregated with help of the
item_cmp_type() function.
sql/item.h:
The new function result_as_longlong() is added to the Item class.
It indicates that the item is a date/time item and result of it can be
compared as int. Such items are date/time fields/functions.
mysql-test/t/func_time.test:
Added test case fot bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.
mysql-test/r/func_time.result:
Added test case fot bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.
mysql-test/r/func_str.result:
Fix for bug #12728: Very strange behaviour of ELT
- test case
mysql-test/t/func_str.test:
Fix for bug #12728: Very strange behaviour of ELT
- test result
sql/item_strfunc.cc:
Fix for bug #12728: Very strange behaviour of ELT
- Item_func_elt::eq() introduced: check 'item' member as well
(to distinguish for instance elt(1, 'a', 'b') and elt(2, 'a', 'b')
sql/item_strfunc.h:
Fix for bug #12728: Very strange behaviour of ELT
- Item_func_elt::eq() introduced: check 'item' member as well
(to distinguish for instance elt(1, 'a', 'b') and elt(2, 'a', 'b')
There was a wrong determination of the DB name (witch is
not always the one in TABLE_LIST because derived tables
may be calculated using temp tables that have their db name
set to "").
The fix determines the database name according to the type
of table reference, and calls the function check_access()
with the correct db name so the correct set of grants is found.
mysql-test/r/view_grant.result:
testsuite for the bug
mysql-test/t/view_grant.test:
testsuite for the bug
sql/sql_parse.cc:
correct determination of the db name.
into mysql.com:/home/marty/MySQL/mysql-5.0
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
ndb/src/kernel/blocks/dbdict/DictLock.txt:
NR signals
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
call removeStaleDictLocks at right place, comment why it works
more checks, better logging
ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
call removeStaleDictLocks at right place, comment why it works
more checks, better logging
ndb/include/kernel/signaldata/DictLock.hpp:
2 more REFs
ndb/include/ndb_version.h.in:
DICT LOCK appeared in 5.0.23
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
DICT LOCK rolling upgrade from version < 5.0.23
ndb/src/kernel/blocks/ERROR_codes.txt:
more DICT LOCK related testing
ndb/test/ndbapi/testDict.cpp:
more DICT LOCK related testing
into mysql.com:/home/mydev/mysql-5.0-amerge
mysql-test/r/lock_multi.result:
Merging 5.0-engines to 5.0 master.
mysql-test/t/lock_multi.test:
Merging 5.0-engines to 5.0 master.
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
VC++Files/client/mysql.dsp:
Auto merged
mysql-test/t/func_time.test:
Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/item_timefunc.h:
Auto merged
client/mysqldump.c:
Manual merge
mysql-test/r/func_time.result:
Manual merge
mysql-test/mysql-test-run.pl:
Found when fixing bug#20303: The "usage()" function ignored the message it was given,
so we got no real indication about the problem. Print it if one is given.
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
Auto merged
ndb/src/mgmsrv/MgmtSrvr.cpp:
Auto merged
ndb/src/mgmsrv/MgmtSrvr.hpp:
Auto merged
ndb/src/mgmsrv/Services.cpp:
Auto merged
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
Bug #20336 CLUSTERLOG commands have no effect
- with signal sender the clock issuing the command and the revceiver of the events are not the same
ndb/src/mgmsrv/MgmtSrvr.cpp:
Bug #20336 CLUSTERLOG commands have no effect
- make sure to actually send the update to ndb nodes, and wait for the reply
ndb/src/mgmsrv/Services.cpp:
Bug #20336 CLUSTERLOG commands have no effect
- make sure to compute max every time for log level
ndb/src/kernel/main.cpp:
signal log from start (#if 0-ed)
ndb/test/ndbapi/testDict.cpp:
test NF/NR + dict ops
ndb/src/kernel/vm/DLFifoList.hpp:
add hasPrev
ndb/src/kernel/vm/pc.hpp:
ERROR_INSERTED_CLEAR(x) test and clear if set
ndb/src/common/debugger/SignalLoggerManager.cpp:
block no fix
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
spelling
ndb/include/kernel/GlobalSignalNumbers.h:
locking of master DICT against schema ops, used by slave DIH under NR
ndb/include/kernel/signaldata/AlterTable.hpp:
locking of master DICT against schema ops, used by slave DIH under NR
ndb/include/kernel/signaldata/CreateTable.hpp:
locking of master DICT against schema ops, used by slave DIH under NR
ndb/include/kernel/signaldata/DictLock.hpp:
locking of master DICT against schema ops, used by slave DIH under NR
ndb/include/kernel/signaldata/DropTable.hpp:
locking of master DICT against schema ops, used by slave DIH under NR
ndb/src/common/debugger/signaldata/SignalNames.cpp:
locking of master DICT against schema ops, used by slave DIH under NR
ndb/src/kernel/blocks/ERROR_codes.txt:
locking of master DICT against schema ops, used by slave DIH under NR
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
locking of master DICT against schema ops, used by slave DIH under NR
ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
locking of master DICT against schema ops, used by slave DIH under NR
ndb/src/kernel/blocks/dbdih/Dbdih.hpp:
locking of master DICT against schema ops, used by slave DIH under NR
ndb/src/kernel/blocks/dbdih/DbdihInit.cpp:
locking of master DICT against schema ops, used by slave DIH under NR
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
locking of master DICT against schema ops, used by slave DIH under NR
ndb/src/ndbapi/ndberror.c:
locking of master DICT against schema ops, used by slave DIH under NR
mysql-test/mysql-test-run.pl:
A fix for bug#20303 "mysql-test-run.pl: Does not recognize -- argument":
Due to the use of 'pass_through' in option processing this lone '--' will remain
as an argument, it must be ignored explicitly.
query
Problem:
There was a wrong context assigned to the columns that were added in insert_fields()
when expanding a '*'. When this is done in a prepared statement it causes
fix_fields() to fail to find the table that these columns reference.
Actually the right context is set in setup_natural_join_row_types() called at the
end of setup_tables(). However when executed in a context of a prepared statement
setup_tables() resets the context, but setup_natural_join_row_types() was not
setting it to the correct value assuming it has already done so.
Solution:
The top-most, left-most NATURAL/USING join must be set as a
first_name_resolution_table in context even when operating on prepared statements.
mysql-test/r/join.result:
testsuite for the bug
mysql-test/t/join.test:
testsuite for the bug
sql/sql_base.cc:
The context must be set even when executed as prepared statement.
into mysql.com:/home/stewart/Documents/MySQL/5.0/merge-queue
ndb/include/mgmapi/mgmapi.h:
Auto merged
ndb/src/mgmapi/mgmapi.cpp:
Auto merged
ndb/src/mgmclient/CommandInterpreter.cpp:
Auto merged
ndb/src/mgmsrv/MgmtSrvr.hpp:
Auto merged
ndb/src/mgmsrv/Services.cpp:
Auto merged
ndb/src/mgmsrv/Services.hpp:
Auto merged
ndb/src/mgmsrv/MgmtSrvr.cpp:
hand merge bug fix by tomas with my fix for stop/shutdown behaviour