into gleb.loc:/home/uchum/work/bk/5.0-opt
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_load.cc:
Auto merged
mysql-test/r/loaddata.result:
Merge with 4.1-opt.
mysql-test/t/loaddata.test:
Merge with 4.1-opt.
The `SELECT 'r' INTO OUTFILE ... FIELDS ENCLOSED BY 'r' ' statement
encoded the 'r' string to a 4 byte string of value x'725c7272'
(sequence of 4 characters: r\rr).
The LOAD DATA statement decoded this string to a 1 byte string of
value x'0d' (ASCII Carriage Return character) instead of the original
'r' character.
The same error also happened with the FIELDS ENCLOSED BY clause
followed by special characters: 'n', 't', 'r', 'b', '0', 'Z' and 'N'.
NOTE 1: This is a result of the undocumented feature: the LOAD DATA INFILE
recognises 2-byte input sequences like \n, \t, \r and \Z in addition
to documented 2-byte sequences: \0 and \N. This feature should be
documented (here backspace character is a default ESCAPED BY character,
in the real-life example it may be any ESCAPED BY character).
NOTE 2, changed behaviour:
Now the `SELECT INTO OUTFILE' statement with the `FIELDS ENCLOSED BY'
clause followed by one of: 'n', 't', 'r', 'b', '0', 'Z' or 'N' characters
encodes this special character itself by doubling it ('r' --> 'rr'),
not by prepending it with an escape character.
sql/sql_class.h:
Fixed bug #29294.
The ESCAPE_CHARS macro constant is defined to enumerate
symbolic names of espace-sequences like '\n', '\t' etc.
The select_export::is_ambiguous_field_sep field has been added
to distinguish special values of the field_sep field from
another values (see ESCAPE_CHARS).
sql/sql_class.cc:
Fixed bug #29294.
The select_export::send_data method has been modified to
encode special values of the field_sep field by
doubling of those values instead of prepending them with a
value of the escape_char field.
Example: The SELECT 'r' INTO OUTFILE FIELDS ENCLOSED BY 'r'
now produces the 'rr' output string instead of x'5c72'
(i.e. instead of sequence of 2 bytes: \ and r).
sql/sql_load.cc:
Fixed bug #29294.
Added commentary for the READ_INFO::unescape method.
mysql-test/t/loaddata.test:
Updated test case for bug #29294.
mysql-test/r/loaddata.result:
Updated test case for bug #29294.
asserts debug binary
We can't reliably check if the binary log is opened without
acquiring its mutex.
Fixed by removing this check.
sql/log.cc:
Bug #28983:
can't reliably check if bin_log is open outside of its mutex
This bug may manifest itself not only with the queries for which
the index-merge access method is chosen. It also may display
itself for queries with DISTINCT.
The bug was in how the Unique::get method used the merge_buffers
function. To compare elements in the the queue employed by
merge_buffers() it must use the buffpek_compare function rather
than the function for binary comparison.
mysql-test/r/innodb_mysql.result:
Added a test case for bug #25798.
mysql-test/t/innodb_mysql.test:
Added a test case for bug #25798.
sql/filesort.cc:
Fixed bug #25798.
The function merge_buffers() when called from the Uniques::get method
must use function buffpek_compare to compare elements in the queue it
employs. The pointer to buffpek_compare and the info for the function
that compares sorted records are passed to merge_buffers through certain
designated fields of the SORTPARAM structure.
sql/sql_sort.h:
Fixed bug #25798.
Added fields to the SORTPARAM structure to be used in the function
merge_buffers when called by the Uniques::get method.
sql/uniques.cc:
Fixed bug 25798.
The function merge_buffers() when called from the Uniques::get method
must use function buffpek_compare to compare elements in the queue it
employes.
into olga.mysql.com:/home/igor/mysql-5.0-opt
mysql-test/r/type_enum.result:
Auto merged
mysql-test/t/type_enum.test:
Auto merged
sql/field_conv.cc:
SCCS merged
When a UNION statement forced conversion of an UTF8
charset value to a binary charset value, the byte
length of the result values was truncated to the
CHAR_LENGTH of the original UTF8 value.
sql/item.cc:
Fixed bug #29205.
The calculation of data length was modified in
the Item_type_holder::join_types method to take into
account possible conversion of a multibyte charset
value to a binary charset value, when each
multibyte character is converted into a sequence
of bytes (not to a single byte of binary charset).
mysql-test/t/ctype_utf8.test:
Updated test case for bug #29205.
mysql-test/r/ctype_utf8.result:
Updated test case for bug #29205.
query / no aggregate of subquery
The optimizer counts the aggregate functions that
appear as top level expressions (in all_fields) in
the current subquery. Later it makes a list of these
that it uses to actually execute the aggregates in
end_send_group().
That count is used in several places as a flag whether
there are aggregates functions.
While collecting the above info it must not consider
aggregates that are not aggregated in the current
context. It must treat them as normal expressions
instead. Not doing that leads to incorrect data about
the query, e.g. running a query that actually has no
aggregate functions as if it has some (and hence is
expected to return only one row).
Fixed by ignoring the aggregates that are not aggregated
in the current context.
One other smaller omission discovered and fixed in the
process : the place of aggregation was not calculated for
user defined functions. Fixed by calling
Item_sum::init_sum_func_check() and
Item_sum::check_sum_func() as it's done for the rest of
the aggregate functions.
mysql-test/r/subselect.result:
Bug #27333: test case
mysql-test/t/subselect.test:
Bug #27333: test case
sql/item_subselect.cc:
Bug#27333: need select_lex to filter out
aggregates that are not aggregated in
the current select.
sql/item_sum.cc:
Bug#27333: need select_lex to filter out
aggregates that are not aggregated in
the current select.
sql/item_sum.h:
Bug#27333: calculate the place of
aggregation for user defined functions.
sql/sql_select.cc:
Bug#27333: When counting the aggregated functions
and collecting a list of them we must not consider
the aggregates that are not aggregated in the local
context as "local" : i.e. we must treat them as
normal functions and not add them to the aggregate
functions list.
sql/sql_select.h:
Bug#27333: need select_lex to filter out
aggregates that are not aggregated in
the current select.
SHOW CREATE TABLE or SELECT FROM I_S.
Actually, the bug discovers two problems:
- the original query is not preserved properly. This is the problem
of BUG#16291;
- the resultset of SHOW CREATE TABLE statement is binary.
This patch fixes the second problem for the 5.0.
Both problems will be fixed in 5.1.
mysql-test/r/show_check.result:
Update result file.
mysql-test/t/show_check.test:
Provide test case for BUG#10491.
sql/item.h:
Use utf8_general_ci instead of binary collation by default,
because for views and base tables utf8 is the character set
in which their definition is stored. For system constants
it's the default character set, and for other objects
(routines, triggers), no character set is stored, and
therefore no character set is known, so returning utf8
is just as good as any non-binary character set.
This latter problem is fixed in 5.1 by 16291. In 5.1
we will return the "real" character set.
Thanks to Martin Friebe for finding and submitting a fix for this bug!
A table with maximum number of key segments and maximum length key name
would have a corrupted .frm file, due to an incorrect calculation of the
complete key length. Now the key length is computed correctly (I hope) :-)
MyISAM would reject a table with the maximum number of keys and the maximum
number of key segments in all keys. It would allow one less than this total
maximum. Now MyISAM accepts a table defined with the maximum. (This is a
very minor issue.)
myisam/mi_open.c:
Bug #26642: change >= to > in a comparison (i.e., error
only if key_parts_in_table really is greater than
MAX_KEY * MAX_KEY_SEG)
mysql-test/r/create.result:
Bug #26642: test case
mysql-test/t/create.test:
Bug #26642: test case
sql/table.cc:
Bug #26642: In create_frm(), fix formula for key_length;
it was too small by (keys * 2) bytes
Sometimes special 0 ENUM values was ALTERed to normal
empty string ENUM values.
Special 0 ENUM value has the same string representation
as normal ENUM value defined as '' (empty string).
The do_field_string function was used to convert
ENUM data at an ALTER TABLE request, but this
function doesn't care about numerical "indices" of
ENUM values, i.e. do_field_string doesn't distinguish
a special 0 value from an empty string value.
A new copy function called do_field_enum has been added to
copy special 0 ENUM values without conversion to an empty
string.
sql/field_conv.cc:
Fixed bug #29251.
The Copy_field::get_copy_func method has been modified to
return a pointer to the do_field_enum function if a conversion
between two columns of incompatible enum types is required.
The do_field_enum function has been added for the correct
conversion of special 0 enum values.
mysql-test/t/type_enum.test:
Updated test case for bug #29251.
mysql-test/r/type_enum.result:
Updated test case for bug #29251.
LOCK TABLES takes a list of tables to lock. It may lock several
tables successfully and then encounter a tables that it can't lock,
e.g. because it's locked. In such case it needs to undo the locks on
the already locked tables. And it does that. But it has also notified
the relevant table storage engine handlers that they should lock.
The only reliable way to ensure that the table handlers will give up
their locks is to end the transaction. This is what UNLOCK TABLE
does : it ends the transaction if there were locked tables by LOCK
tables.
It is possible to end the transaction when the lock fails in
LOCK TABLES because LOCK TABLES ends the transaction at its start
already.
Fixed by ending (again) the transaction when LOCK TABLES fails to
lock a table.
mysql-test/r/innodb_mysql.result:
Bug #29154: test case
mysql-test/t/innodb_mysql.test:
Bug #29154: test case
sql/sql_parse.cc:
Bug #29154: end the trasaction at a failing
LOCK TABLES so the handler can free its locks.
the loose scan optimization for grouping queries was applied returned
a wrong result set when the query was used with the SQL_BIG_RESULT
option.
The SQL_BIG_RESULT option forces to use sorting algorithm for grouping
queries instead of employing a suitable index. The current loose scan
optimization is applied only for one table queries when the suitable
index is covering. It does not make sense to use sort algorithm in this
case. However the create_sort_index function does not take into account
the possible choice of the loose scan to implement the DISTINCT operator
which makes sorting unnecessary. Moreover the current implementation of
the loose scan for queries with distinct assumes that sorting will
never happen. Thus in this case create_sort_index should not call
the function filesort.
mysql-test/r/group_min_max.result:
Added a test case for bug #25602.
mysql-test/t/group_min_max.test:
Added a test case for bug #25602.
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.
into adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
into mysql.com:/home/bar/mysql-work/mysql-5.0.b28925
sql/sql_yacc.yy:
Auto merged
mysql-test/r/ctype_ucs2_def.result:
After merge fix
mysql-test/t/ctype_ucs2_def.test:
After merge fix
Problem: separator was not converted to the result character set,
so the result was a mixture of two different character sets,
which was especially bad for UCS2.
Fix: convert separator to the result character set.
mysql-test/r/ctype_ucs.result:
Adding test case
mysql-test/r/ctype_ucs2_def.result:
Adding test case
mysql-test/t/ctype_ucs.test:
Adding test case
mysql-test/t/ctype_ucs2_def.test:
Adding test case
sql/item_sum.cc:
Adding conversion of separator to the result character set
sql/sql_yacc.yy:
Fixing GROUPC_CONCAT problems when "mysqld --default-character-set=ucs2".
ALTER VIEW is currently not supported as a prepared statement
and should be disabled as such as they otherwise could cause server crashes.
ALTER VIEW is currently not supported when called from stored
procedures or functions for related reasons and should also be disabled.
This patch disables these DDL statements and adjusts the appropriate test
cases accordingly.
Additional tests has been added to reflect on the fact that we do support
CREATE/ALTER/DROP TABLE for Prepared Statements (PS), Stored Procedures (SP)
and PS within SP.
mysql-test/r/ps_1general.result:
- Updated test to reflect on the new policy to disallow ALTER VIEW within SP.
mysql-test/r/sp-dynamic.result:
- Added PS ALTER TABLE test from within SP-context to demonstrate that CREATE/ALTER/DROP
TABLE statements is working.
- Added PS CREATE/ALTER/DROP VIEW tests from within SP-context to show that
ALTER VIEW is not supported, CREATE VIEW/DROP VIEW are supported.
mysql-test/r/sp-error.result:
- Updated test to reflect on the new policy to disallow VIEW DDL within SP.
mysql-test/t/ps_1general.test:
- Updated test to reflect on the new policy to disallow VIEW DDL within SP.
mysql-test/t/sp-dynamic.test:
- Add PS ALTER TABLE test from within SP to demonstrate that CREATE/ALTER/DROP
TABLE statements are supported.
mysql-test/t/sp-error.test:
- Updated test to reflect on the new policy to disallow ALTER VIEW
within SP-context.
- Changed error code 1314 to the more abstract ER_SP_BADSTATEMENT.
sql/sql_class.h:
- Added comment for clarity
sql/sql_parse.cc:
- Added comment for clarity
sql/sql_prepare.cc:
- Disallow ALTER VIEW as prepared statements until they are
properly supported. Note that SQLCOM_CREATE_VIEW also handles ALTER VIEW
statements.
sql/sql_view.cc:
- converted to doxygen comments
- Added comment for clarity
sql/sql_yacc.yy:
- Disallow ALTER VIEW statements within a SP.
If the parser is operating within the SP context, this is shown
on the sp->sphead pointer. If this flag is set for view DDL operations
we stop parsing with the error 'ER_SP_BAD_STATEMENT'.
long shared-memory-base-names could overflow a static internal buffer
and thus crash mysqld and various clients. change both to dynamic
buffers, show everything but overflowing those buffers still works.
The test case for this would pretty much amount to
mysqld --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --shared-memory=1 &
mysqladmin --no-defaults --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX shutdown
Unfortunately, we can't just use an .opt file for the
server. The .opt file is used at start-up, before any
include in the actual test can tell mysqltest to skip
this one on non-Windows. As a result, such a test would
break on unices.
Fixing mysql-test-run.pl to export full path for master
and slave would enable us to start a server from within
the test which is ugly and, what's more, doesn't work as
the server blocks (mysqltest offers no fire-and-forget
fork-and-exec), and mysqladmin never gets run.
Making the test rpl_windows_shm or some such so we can
is beyond ugly. As is introducing another file-name based
special case (run "win*.test" only when on Windows). As is
(yuck) coding half the test into mtr (as in, having it
hand out a customized environment conductive to the shm-
thing on Win only).
Situation is exacerbated by the fact that .sh is not
necessary run as expected on Win.
In short, it's just not worth it. No test-case until we
have a new-and-improved test framework.
sql-common/client.c:
Bug#24924: shared-memory-base-name that is too long causes buffer overflow
compose shared memory name in dynamic rather than static buffer to prevent
overflows (clients)
sql/mysqld.cc:
Bug#24924: shared-memory-base-name that is too long causes buffer overflow
compose shared memory name in dynamic rather than static buffer to prevent
overflows (server)
Occasionally mysqlbinlog --hexdump failed with error:
ERROR 1064 (42000) at line ...: You have an error in your
SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near
'Query thread_id=... exec_time=... error_code=...
When the length of hexadecimal dump of binlog header was
divisible by 16, commentary sign '#' after header was lost.
The Log_event::print_header function has been modified to always
finish hexadecimal binlog header with "\n# ".
sql/log_event.cc:
Fixed bug #28293.
The Log_event::print_header function has been modified to always
finish hexadecimal binlog header with "\n# ".
mysql-test/r/mysqlbinlog.result:
Updated test case for bug #28293.
mysql-test/t/mysqlbinlog.test:
Updated test case for bug #28293.
The abort happened when a query contained a conjunctive predicate
of the form 'view column = constant' in the WHERE condition and
the grouping list also contained a reference to a view column yet
a different one.
Removed the failing assertion as invalid in a general case.
Also fixed a bug that prevented applying some optimization for grouping
queries using views. If the WHERE condition of such a query contains
a conjunctive condition of the form 'view column = constant' and
this view column is used in the grouping list then grouping by this
column can be eliminated. The bug blocked performing this elimination.
mysql-test/r/view.result:
Added a test case for bug #29104.
mysql-test/t/view.test:
Added a test case for bug #29104.
sql/item.cc:
Fixed bug #29104: assertion abort for grouping queries using views.
The abort happened when a query contained a conjunctive predicate
of the form 'view column = constant' in the WHERE condition and
the grouping list also contained a reference to a view column yet
a different one.
Removed the failing assertion as invalid in a general case.
Also fixed a bug that prevented applying some optimization for grouping
queries using views. If the WHERE condition of such a query contains
a conjunctive condition of the form 'view column = constant' and
this view column is used in the grouping list then grouping by this
column can be eliminated. The bug blocked performing this elimination.
This bug was in the function Item_field::eq while the failing
assertion was in the function Item_direct_view_ref::eq.
and replicated):
A DROP USER statement with a non-existing user was correctly written to
the binary log (there might be users that were removed, but not all),
but the error code was not set, which caused the slave to stop with an
error.
The error reporting code was moved to before the statement was logged
to ensure that the error information for the thread was correctly set
up. This works since my_error() will set the fields net.last_errno and
net.last_error for the thread that is reporting the error, and this
will then be picked up when the Query_log_event is created and written
to the binary log.
sql/sql_acl.cc:
Moving error reporting code to ensure that thd->net.last_err{or,no} is
set and adding debug printout.
mysql-test/r/rpl_grant.result:
New BitKeeper file ``mysql-test/r/rpl_grant.result''
mysql-test/t/rpl_grant.test:
New BitKeeper file ``mysql-test/t/rpl_grant.test''
forgotten merge with 5.0. There can be some bugs waiting for this fix in 5.0 like Bug@29232
sql/log_event.cc:
file name is changed in step with the position.
slave_sql thread calls thd->clear_error() to force error to be ignored,
though this method didn't clear thd->killed state, what causes
slave_sql thread to stop.
clear thd->killed state if we ignore an error
mysql-test/r/rpl_skip_error.result:
Bug #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists.
test result
mysql-test/t/rpl_skip_error.test:
Bug #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists.
test case
sql/log_event.cc:
Bug #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists.
clear thd->killed state if we ignore the error
For a join query with GROUP BY and/or ORDER BY and a view reference
in the FROM list the metadata erroneously showed empty table aliases
and database names for the view columns.
sql/item.h:
Fixed bug #28898.
Body of Item_ref::get_tmp_table_item method has been moved
to item.cc file.
mysql-test/t/metadata.test:
Updated test case for bug #28898.
sql/item.cc:
Fixed bug #28898.
The Item_ref::get_tmp_table_item method has been modified
to copy pointers to the table alias and database name to the new
Item_field object created for a field stored in the temporary
table.
mysql-test/r/metadata.result:
Updated test case for bug #28898.
sql/sql_select.cc:
Fixed bug #28898.
The change_to_use_tmp_fields function has been modified to
to copy pointers to the table alias and database name from
the Item_ref objects to the new Item_field objects created
for fields stored in the temporary table.