When calculating the result length of an integer DIV function
the number of decimals was used without checking the result type
first. Thus an uninitialized number of decimals was used for some
types. This caused an excessive amount of memory to be allocated
for the field's buffer and crashed the server.
Fixed by using the number of decimals only for data types that
can have decimals and thus have valid decimals number.
mysql-test/r/func_math.result:
Bug #30587: test case
mysql-test/t/func_math.test:
Bug #30587: test case
sql/item_func.cc:
Bug #30587: Don't use decimals on a type that doesn't have them.
When expanding a * in a USING/NATURAL join the check for table access
for both tables in the join was done using the grant information of the
first one.
Fixed by getting the grant information for the current table while
iterating through the columns of the join.
mysql-test/r/grant2.result:
Bug #30468: test case
mysql-test/t/grant2.test:
Bug #30468: test case
sql/sql_acl.cc:
Bug #30468: correctly check column grants
sql/sql_acl.h:
Bug #30468: correctly check column grants
sql/sql_base.cc:
Bug #30468: correctly check column grants
sql/sql_insert.cc:
Bug #30468: correctly check column grants
When storing the VIEW the CREATE VIEW command is reconstructed
from the parse tree. While constructing the command string
the index hints specified should also be printed.
Fixed by adding code to print the index hints when printing a
table in the FROM clause.
mysql-test/r/view.result:
Bug #28702: test case
mysql-test/t/view.test:
Bug #28702: test case
sql/sql_select.cc:
Bug #28702: preserve index hints in a VIEW definition.
sql/table.h:
Bug #28702: preserve index hints in a VIEW definition.
into macbook.local:/Users/kgeorge/mysql/work/B28701-merged-5.0-opt
sql/sql_view.cc:
Auto merged
mysql-test/r/view.result:
merge with 5.0-opt
mysql-test/t/view.test:
merge with 5.0-opt
type of the result.
There are several functions that accept parameters of different types.
The result field type of such functions was determined based on
the aggregated result type of its arguments. As the DATE and the DATETIME
types are represented by the STRING type, the result field type
of the affected functions was always STRING for DATE/DATETIME arguments.
The affected functions are COALESCE, IF, IFNULL, CASE, LEAST/GREATEST, CASE.
Now the affected functions aggregate the field types of their arguments rather
than their result types and return the result of aggregation as their result
field type.
The cached_field_type member variable is added to the number of classes to
hold the aggregated result field type.
The str_to_date() function's result field type now defaults to the
MYSQL_TYPE_DATETIME.
The agg_field_type() function is added. It aggregates field types with help
of the Field::field_type_merge() function.
The create_table_from_items() function now uses the
item->tmp_table_field_from_field_type() function to get the proper field
when the item is a function with a STRING result type.
libmysql/libmysql.c:
Bug#27216: functions with parameters of different date types may return wrong
type of the result.
The client library now accepts the NEWDATE type as a string.
sql/item_cmpfunc.cc:
Bug#27216: functions with parameters of different date types may return wrong
type of the result.
Now the fix_length_and_dec functions of the
Item_func_ifnull,Item_func_if, Item_func_case, Item_func_coalesce
classes are use agg_field_type function to find out the type of their
result field.
sql/item_cmpfunc.h:
Bug#27216: functions with parameters of different date types may return wrong
type of the result.
The cached_field type is added to the Item_func_case, Item_func_if and
Item_func_coalesce classes.
The field_type function is added to the Item_func_ifnull, Item_func_if,
Item_func_coalesce, Item_func_case classes.
sql/item_func.cc:
Bug#27216: functions with parameters of different date types may return wrong
type of the result.
The Item_func_min_max::fix_length_and_dec function now uses the agg_field_type
function to find out the correct type of the result field.
sql/item_func.h:
Bug#27216: functions with parameters of different date types may return wrong
type of the result.
The cached_field_type variable is added to the Item_func_min_max class.
sql/item_timefunc.cc:
Bug#27216: functions with parameters of different date types may return wrong
type of the result.
The result of the str_to_date function now defaults to the
DATETIME type.
sql/mysql_priv.h:
Bug#27216: functions with parameters of different date types may return wrong
type of the result.
The prototype of the agg_field_type function is added.
sql/protocol.cc:
Bug#27216: functions with parameters of different date types may return wrong
type of the result.
The Protocol_simple::store function is now used to store fields of NEWDATE type.
sql/sql_insert.cc:
Bug#27216: functions with parameters of different date types may return wrong
type of the result.
The create_table_from_items function now uses the
tmp_table_field_from_field_type function to get field for items with the
STRING result type.
mysql-test/r/date_formats.result:
A test case result corrected after fixing bug#27216.
mysql-test/r/type_datetime.result:
Added a test case for the bug#27216: functions with parameters of different
date types may return wrong type of the result.
mysql-test/t/type_datetime.test:
Added a test case for the bug#27216: functions with parameters of different
date types may return wrong type of the result.
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.
Non-definer of a view was allowed to alter that view. Due to this the alterer
can elevate his access rights to access rights of the view definer and thus
modify data which he wasn't allowed to modify. A view defined with
SQL SECURITY INVOKER can't be used directly for access rights elevation.
But a user can first alter the view SQL code and then alter the view to
SQL SECURITY DEFINER and thus elevate his access rights. Due to this
altering a view with SQL SECURITY INVOKER is also prohibited.
Now the mysql_create_view function allows ALTER VIEW only to the view
definer or a super user.
mysql-test/t/view_grant.test:
Added a test case for the bug#29908: A user can gain additional access through the
ALTER VIEW.
A test case was adjusted after fixfing bug#29908.
mysql-test/r/view_grant.result:
Added a test case for the bug#29908: A user can gain additional access through the
ALTER VIEW.
sql/sql_view.cc:
Bug#29908: A user can gain additional access through the ALTER VIEW.
Now the mysql_create_view function allows ALTER VIEW only to the view
definer or a super user.
added get_field_default_value() function which obtains default value from the field
(used in store_create_info() & get_schema_column_record() functions)
mysql-test/r/alter_table.result:
result fix
mysql-test/r/create.result:
result fix
mysql-test/r/ctype_collate.result:
result fix
mysql-test/r/ctype_recoding.result:
result fix
mysql-test/r/default.result:
result fix
mysql-test/r/gis.result:
result fix
mysql-test/r/grant.result:
result fix
mysql-test/r/information_schema.result:
result fix
mysql-test/r/key.result:
result fix
mysql-test/r/mysql.result:
result fix
mysql-test/r/ps_1general.result:
result fix
mysql-test/r/show_check.result:
result fix
mysql-test/r/sp.result:
result fix
mysql-test/r/type_enum.result:
result fix
mysql-test/r/type_ranges.result:
result fix
mysql-test/t/information_schema.test:
test case
The optimizer sets index traversal in reverse order only if there are
used key parts that are not compared to a constant.
However using the primary key as an ORDER BY suffix rendered the check
incomplete : going in reverse order must still be used even if
all the parts of the secondary key are compared to a constant.
Fixed by relaxing the check and set reverse traversal even when all
the secondary index keyparts are compared to a const.
Also account for the case when all the primary keys are compared to a
constant.
mysql-test/r/innodb_mysql.result:
Bug #31001: test case
mysql-test/t/innodb_mysql.test:
Bug #31001: test case
sql/sql_select.cc:
Bug #31001:
- account for the case when all the primary key parts are compared
to a constant
- force test_if_skip_sort_order to go backwards over the key even
when the number of keyparts used is the same as the number of
keyparts equal to a constant. (because of the primary key
suffix).
- The bug was caused by COUNT(DISTINCT ...) code using Unique object in
a way that assumed that BIT(N) column occupies a contiguous space in
temp_table->record[0] buffer.
- The fix is to make COUNT(DISTINCT ...) code instruct create_tmp_table to
create temporary table with column of type BIGINT, not BIT(N).
mysql-test/r/type_bit.result:
BUG#30324: Grouping queries with COUNT(DISTINCT bit column) return wrong results
- Testcase
mysql-test/t/type_bit.test:
BUG#30324: Grouping queries with COUNT(DISTINCT bit column) return wrong results
- Testcase
sql/item_sum.cc:
BUG#30324: Grouping queries with COUNT(DISTINCT bit column) return wrong results
- Make COUNT(DISTINCT ...) code instruct create_tmp_table to create
temporary table with BIGINT, not BIT(N) column.
Declaring an all space column name in the SELECT FROM DUAL or in a view
leads to misleading warning message:
"Leading spaces are removed from name ' '".
The Item::set_name method has been modified to raise warnings like
"Name ' ' has become ''" in case of the truncation of an all
space identifier to an empty string identifier instead of the
"Leading spaces are removed from name ' '" warning message.
sql/item.cc:
Fixed bug #27695.
The Item::set_name method has been modified to raise warnings like
"Name ' ' has become ''" in case of the truncation of an all
space identifier to an empty string identifier instead of the
"Leading spaces are removed from name ' '" warning message.
sql/share/errmsg.txt:
Fixed bug #27695.
mysql-test/t/select.test:
Added test case for bug #27695.
mysql-test/r/select.result:
Added test case for bug #27695.
in get_index_for_order(), don't walk over the end of the index key parts
when matching index description and needed ordering.
mysql-test/r/delete.result:
BUG#30385: Testcase
mysql-test/t/delete.test:
BUG#30385: Testcase
into weblab.(none):/home/marcsql/TREE/mysql-5.0-rt-merge
mysql-test/r/sp.result:
Auto merged
mysql-test/t/mysql.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
DELETE FROM ... USING ... statements with the following type of
ambiguous aliasing gave unexpected results:
DELETE FROM t1 AS alias USING t1, t2 AS alias WHERE t1.a = alias.a;
This query would leave table t1 intact but delete rows from t2.
Fixed by changing DELETE FROM ... USING syntax so that only alias
references (as opposed to alias declarations) may be used in FROM.
mysql-test/r/delete.result:
Bug#30234: Test Result
mysql-test/t/delete.test:
Bug#30234: Test Case
sql/sql_yacc.yy:
Bug#30234:
- Added parser rule table_alias_ref_list that contains a list of table
aliases only.
- Added parser rule table_alias_ref that sets the TL_OPTION_ALIAS in
order to turn off semantic checking that applies only for table names.
Use view db name as thread default database, in order to ensure
that the view is parsed and prepared correctly.
mysql-test/r/sp.result:
test result
mysql-test/t/sp.test:
test case
sql/sql_parse.cc:
copy thd->db_length to table_list->db_length
sql/sql_view.cc:
Use view db name as thread default database, in order to ensure
that the view is parsed and prepared correctly.
When dumping database from a 4.x server, the mysqldump client
inserted a delimiter sign inside special commentaries of the form:
/*!... CREATE DATABASE IF NOT EXISTS ... ;*/
During restoration that dump file was splitten by delimiter signs on
the client side, and the rest of some commentary strings was prepended
to following statements.
The 4x_server_emul test case option has been added for use with the
DBUG_EXECUTE_IF debugging macro. This option affects debug server
builds only to emulate particular behavior of a 4.x server for
the mysqldump client testing. Non-debugging builds are not affected.
mysql-test/r/mysqldump-compat.result:
Added test case for bug #30126.
mysql-test/t/mysqldump-compat.opt:
Added test case for bug #30126.
mysql-test/t/mysqldump-compat.test:
Added test case for bug #30126.
sql/sql_parse.cc:
Fixed bug #30126.
The mysqldump client uses the "SHOW CREATE DATABASE" query to
obtain the "CREATE DATABASE" statement from that database.
The 4.x server doesn't recognise that query, and mysqldump
forms the "CREATE DATABASE" statement from scratch.
That statement was formed incorrectly.
To enforce the mysqldump client to create that statement from
scratch, debugging code has been added to the mysql_execute_command
function: in tcase of the --loose-debug=d,4x_server_emul option,
the server returns parse error to client to emulate old behaviour.
The 4x_server_emul test case option has been added for use with the
DBUG_EXECUTE_IF debugging macro. This option affects debug server
builds only to emulate particular behavior of a 4.x server for
the mysqldump client testing. Non-debugging builds are not affected.
client/mysqldump.c:
Fixed bug #30126.
The init_dumping_tables function has been modified to output semicolon
outside of commentaries.
Problem:
In cases when a client-side macro appears inside a server-side comment, the add_line() function in mysql.cc discarded all characters until the next delimiter to remove macro arguments from the query string. This resulted in broken queries being sent to the server when the next delimiter character appeared past the comment's boundaries, because the comment closing sequence ('*/') was discarded.
Fix:
If a client-side macro appears inside a server-side comment, discard all characters in the comment after the macro (that is, until the end of the comment rather than the next delimiter).
This is a minimal fix to allow only simple cases used by the mysqlbinlog utility. Limitations that are worth documenting:
- Nested server-side and/or client-side comments are not supported by mysql.cc
- Using client-side macros in multi-line server-side comments is not supported
- All characters after a client-side macro in a server-side comment will be omitted from the query string (and thus, will not be sent to server).
client/mysql.cc:
If a client-side macro appears inside a server-side comment, discard all characters in the comment after the macro.
mysql-test/r/mysql.result:
Added a test case for bug #30164.
mysql-test/t/mysql.test:
Added a test case for bug #30164.
comments)
Before this fix, the server would accept queries that contained comments,
even when the comments were not properly closed with a '*' '/' marker.
For example,
select 1 /* + 2 <EOF>
would be accepted as
select 1 /* + 2 */ <EOF>
and executed as
select 1
With this fix, the server now rejects queries with unclosed comments
as syntax errors.
Both regular comments ('/' '*') and special comments ('/' '*' '!') must be
closed with '*' '/' to be parsed correctly.
mysql-test/r/comments.result:
Unbalanced comments are a syntax error.
mysql-test/t/comments.test:
Unbalanced comments are a syntax error.
sql/sql_lex.cc:
Unbalanced comments are a syntax error.
seems to be converted as varbinary.
The bug has been already fixed. This CS just adds a test case for it.
mysql-test/r/sp.result:
Update result file.
mysql-test/t/sp.test:
Test case for BUG#13675.
into linux-st28.site:/home/martin/mysql/src/bugx/my50-bugx
mysql-test/t/innodb_mysql.test:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/innodb_mysql.result:
SCCS merged
This is a performance bug, affecting in particular the bison generated code
for the parser.
Prior to this fix, the grammar used a long chain of reduces to parse an
expression, like:
bit_expr -> bit_term
bit_term -> bit_factor
bit_factor -> value_expr
value_expr -> term
term -> factor
etc
This chain of reduces cause the internal state automaton in the generated
parser to execute more state transitions and more reduces, so that the
generated MySQLParse() function would spend a lot of time looping to execute
all the grammar reductions.
With this patch, the grammar has been reorganized so that rules are more
"flat", limiting the depth of reduces needed to parse <expr>.
Tests have been written to enforce that relative priorities and properties
of operators have not changed while changing the grammar.
See the bug report for performance data.
mysql-test/r/parser_precedence.result:
Improved test coverage for operator precedence
mysql-test/t/parser_precedence.test:
Improved test coverage for operator precedence
sql/sql_yacc.yy:
Simplified the grammar to improve performances
Currently the Last_query_cost session status variable shows
only the cost of a single flat subselect. For complex queries
(with subselects or unions etc) Last_query_cost is not valid
as it was showing the cost for the last optimized subselect.
Fixed by reseting to zero Last_query_cost when the complete
cost of the query cannot be determined.
Last_query_cost will be non-zero only for single flat queries.
mysql-test/r/status.result:
Bug #30377: test case
mysql-test/t/status.test:
Bug #30377: test case
sql/sql_lex.h:
Bug #30377: helper function
sql/sql_select.cc:
Bug #30377: don't assign cost if not on single level statement
- Merge sslaccept and sslconnect.
- Atomically "reset" vio to VIO_TYPE_SSL when the SSL connection has
succeeded, this avoids having to revert anything and thus protects
against "close_active_vio" in the middle.
- Add some variance to the testcase
mysql-test/t/rpl_ssl.test:
Add some variance by running two selects before stopping the slave
Check that number of records in t1 are equal on master and slave
vio/viossl.c:
Rewrite sslconnect and sslaccept to automically "reset" the vio
to VIO_TYPE_SSL. Also use the fd from 'SSL_get_fd' to avoid
setting vio->sd to -1, that previously occured when "close_active_vio"
was called during connect/accept.
Merge the two function since they were exactly the same except for one line.
Update the DBUG printouts to be generic(i.e use peer instead of client/server).
The optimization that uses a unique index to remove GROUP BY, did not
ensure that the index was actually used, thus violating the ORDER BY
that is impled by GROUP BY.
Fixed by replacing GROUP BY with ORDER BY if the GROUP BY clause contains
a unique index. In case GROUP BY ... ORDER BY null is used, GROUP BY is
simply removed.
BitKeeper/etc/ignore:
Added support-files/mysqld_multi.server tests/bug25714 cscope.in.out cscope.out cscope.po.out to the ignore list
mysql-test/r/distinct.result:
Bug#30596: Changed test case.
Prior to Bug#16458, These queries use temp table and filesort. The
bug was that they used a temp table. However, that patch removed
filesort also, in which case we can no longer gurantee correct ordering.
mysql-test/r/group_by.result:
Bug#30596: Correct result
mysql-test/r/innodb_mysql.result:
Bug#30596: Test case for innodb. Here, as opposed to for MyISAM, row
lookup is done using index whenever the index covers the group list.
mysql-test/t/group_by.test:
Bug#30596: Test case
mysql-test/t/innodb_mysql.test:
Bug#30596: Test case
sql/sql_select.cc:
Bug#30596: The fix, replacing GROUP BY with ORDER BY unless
ORDER BY [NULL|<constant>]
If, after the tables are locked, one of the conditions to read from a
HANDLER table is not met, the handler code wrongly jumps to a error path
that won't unlock the tables.
The user-visible effect is that after a error in a handler read command,
all subsequent handler operations on the same table will hang.
The fix is simply to correct the code to jump to the (same) error path that
unlocks the tables.
mysql-test/r/handler.result:
Bug#30632 test case result
mysql-test/t/handler.test:
Bug#30632 test case
sql/sql_handler.cc:
Always unlock the internal and external table level locks if any of the conditions
(including errors) to read from a HANDLER table are not met.
The problem from a user's perspective: user creates table A, and then tries
to CREATE TABLE a SELECT from A - and this causes a deadlock error, a hang,
or fails with a debug assert, but only if the storage engine is InnoDB.
The origin of the problem: InnoDB uses case-insensitive collation
(system_charset_info) when looking up the internal table share, thus returning
the same share for 'a' and 'A'.
Cause of the user-visible behavior: since the same share is returned to SQL
locking subsystem, it assumes that the same table is first locked (within the
same session) for WRITE, and then for READ, and returns a deadlock error.
However, the code is wrong in not properly cleaning up upon an error, leaving
external locks in place, which leads to assertion failures and hangs.
Fix that has been implemented: the SQL layer should properly propagate the
deadlock error, cleaning up and freeing all resources.
Further work towards a more complete solution: InnoDB should not use case
insensitive collation for table share hash if table names on disk honor the case.
mysql-test/r/innodb-deadlock.result:
Bug#25164 test case result
mysql-test/t/innodb-deadlock.test:
Bug#25164 test case. The CREATE TABLE may fail depending on the character set
of the system and filesystem, but it should never hang.
sql/lock.cc:
Unlock the storage engine "external" table level locks, if the MySQL thr_lock
locking subsystem detects a deadlock error.
This is a performance bug, related to the parsing or 'OR' and 'AND' boolean
expressions.
Let N be the number of expressions involved in a OR (respectively AND).
When N=1
For example, "select 1" involve only 1 term: there is no OR operator.
In 4.0 and 4.1, parsing expressions not involving OR had no overhead.
In 5.0, parsing adds some overhead, with Select->expr_list.
With this patch, the overhead introduced in 5.0 has been removed,
so that performances for N=1 should be identical to the 4.0 performances,
which are optimal (there is no code executed at all)
The overhead in 5.0 was in fact affecting significantly some operations.
For example, loading 1 Million rows into a table with INSERTs,
for a table that has 100 columns, leads to parsing 100 Millions of
expressions, which means that the overhead related to Select->expr_list
is executed 100 Million times ...
Considering that N=1 is by far the most probable expression,
this case should be optimal.
When N=2
For example, "select a OR b" involves 2 terms in the OR operator.
In 4.0 and 4.1, parsing expressions involving 2 terms created 1 Item_cond_or
node, which is the expected result.
In 5.0, parsing these expression also produced 1 node, but with some extra
overhead related to Select->expr_list : creating 1 list in Select->expr_list
and another in Item_cond::list is inefficient.
With this patch, the overhead introduced in 5.0 has been removed
so that performances for N=2 should be identical to the 4.0 performances.
Note that the memory allocation uses the new (thd->mem_root) syntax
directly.
The cost of "is_cond_or" is estimated to be neglectable: the real problem
of the performance degradation comes from unneeded memory allocations.
When N>=3
For example, "select a OR b OR c ...", which involves 3 or more terms.
In 4.0 and 4.1, the parser had no significant cost overhead, but produced
an Item tree which is difficult to evaluate / optimize during runtime.
In 5.0, the parser produces a better Item tree, using the Item_cond
constructor that accepts a list of children directly, but at an extra cost
related to Select->expr_list.
With this patch, the code is implemented to take the best of the two
implementations:
- there is no overhead with Select->expr_list
- the Item tree generated is optimized and flattened.
This is achieved by adding children nodes into the Item tree directly,
with Item_cond::add(), which avoids the need for temporary lists and memory
allocation
Note that this patch also provide an extra optimization, that the previous
code in 5.0 did not provide: expressions are flattened in the Item tree,
based on what the expression already parsed is, and not based on the order
in which rules are reduced.
For example : "(a OR b) OR c", "a OR (b OR c)" would both be represented
with 2 Item_cond_or nodes before this patch, and with 1 node only with this
patch. The logic used is based on the mathematical properties of the OR
operator (it's associative), and produces a simpler tree.
sql/item_cmpfunc.h:
Improved performances for parsing boolean expressions
sql/sql_yacc.yy:
Improved performances for parsing boolean expressions
mysql-test/r/parser_precedence.result:
Added test cases to cover boolean operator precedence
mysql-test/t/parser_precedence.test:
Added test cases to cover boolean operator precedence
into adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
mysql-test/r/query_cache.result:
Auto merged
mysql-test/t/query_cache.test:
Auto merged
Although the query cache doesn't support retrieval of statements containing
column level access control, it was still possible to cache such statements
thus wasting memory.
This patch extends the access control check on the target tables to avoid
caching a statement with column level restrictions.
Views are excepted and can be cached but only retrieved by super user account.
mysql-test/t/query_cache_with_views.test:
Rename: mysql-test/t/view_query_cache.test -> mysql-test/t/query_cache_with_views.test
mysql-test/r/query_cache_with_views.result:
Rename: mysql-test/r/view_query_cache.result -> mysql-test/r/query_cache_with_views.result
mysql-test/r/query_cache.result:
Modified test case to allow caching of views
mysql-test/t/query_cache.test:
Modified test case to allow caching of views
sql/sql_cache.cc:
Allow caching of views
added SUPER_ACL check for I_S.TRIGGERS
mysql-test/r/information_schema.result:
result fix
mysql-test/r/information_schema_db.result:
result fix
mysql-test/t/information_schema.test:
test case
sql/sql_show.cc:
added SUPER_ACL check for I_S.TRIGGERS
into adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
mysql-test/r/query_cache.result:
Auto merged
mysql-test/t/query_cache.test:
Auto merged
Although the query cache doesn't support retrieval of statements containing
column level access control, it was still possible to cache such statements
thus wasting memory.
This patch extends the access control check on the target tables to avoid
caching a statement with column level restrictions.
mysql-test/r/query_cache.result:
Added test
mysql-test/t/query_cache.test:
Added test
sql/sql_cache.cc:
The function check_table_access leaves the artifact
grant.want_privileges= 1, if a statement refers to tables with column level
privileges. To avoid the statement from being stored into the query cache,
it is enough to check this flag and set 'safe_to_cache_query' to zero.
sql/sql_cache.h:
- Removed 'static' attribute or class methods
- Added THD parameter to process_and_count_tables
HEAP tables can't index BIT fields. Due to this when grouping by such fields is
needed they are converted to a fields of the LONG type when temporary table
is being created. But a side effect of this is that a wrong type of BIT
fields is returned to a client.
Now the JOIN::prepare and the create_distinct_group functions are create
additional hidden copy of BIT fields to preserve original fields untouched.
New hidden fields are used for grouping instead.
mysql-test/t/type_bit.test:
Added a test case for the bug#30245: A wrong type of a BIT field is reported when grouped by it.
mysql-test/r/type_bit.result:
Added a test case for the bug#30245: A wrong type of a BIT field is reported when grouped by it.
sql/sql_select.cc:
Bug#30245: A wrong type of a BIT field is reported when grouped by it.
Now the JOIN::prepare and the create_distinct_group functions are create
additional hidden copy of BIT fields to preserve original fields untouched.
New hidden fields are used for grouping instead.
The bug caused memory corruption for some queries with top OR level
in the WHERE condition if they contained equality predicates and
other sargable predicates in disjunctive parts of the condition.
The corruption happened because the upper bound of the memory
allocated for KEY_FIELD and SARGABLE_PARAM internal structures
containing info about potential lookup keys was calculated incorrectly
in some cases. In particular it was calculated incorrectly when the
WHERE condition was an OR formula with disjuncts being AND formulas
including equalities and other sargable predicates.
mysql-test/r/select.result:
Added a test case for bug #30396.
mysql-test/t/select.test:
Added a test case for bug #30396.
sql/item_cmpfunc.h:
Removed max_members from the COND_EQUAL class as not useful anymore.
sql/sql_base.cc:
Added the max_equal_elems field to the st_select_lex structure.
sql/sql_lex.cc:
Added the max_equal_elems field to the st_select_lex structure.
sql/sql_lex.h:
Added the max_equal_elems field to the st_select_lex structure.
The field contains the maximal number of elements in multiple equalities
built for the query conditions.
sql/sql_select.cc:
Fixed bug #30396.
The bug caused memory corruption for some queries with top OR level
in the WHERE condition if they contained equality predicates and
other sargable predicates in disjunctive parts of the condition.
The corruption happened because the upper bound of the memory
allocated for KEY_FIELD and SARGABLE_PARAM internal structures
containing info about potential lookup keys was calculated incorrectly
in some cases. In particular it was calculated incorrectly when the
WHERE condition was an OR formula with disjuncts being AND formulas
including equalities and other sargable predicates.
The max_equal_elems field to the st_select_lex structure is used now
to calculate the above mentioned upper bound. The field contains the
maximal number of elements in multiple equalities built for the query
conditions.
mysql_ha_open calls mysql_ha_close on the error path (unsupported) to close the (opened) table before inserting it into the tables hash list handler_tables_hash) but mysql_ha_close only closes tables which are on the hash list, causing the table to be left open and locked.
This change moves the table close logic into a separate function that is always called on the error path of mysql_ha_open or on a normal handler close (mysql_ha_close).
mysql-test/r/handler.result:
Bug#25856 test result
mysql-test/t/handler.test:
Bug#25856 test case
sql/sql_handler.cc:
Move the table close logic into a separate function that is always called on the error path of mysql_ha_open or on a normal handler close
ORDER BY is used
The range analysis module did not correctly signal to the
handler that a range represents a ref (EQ_RANGE flag). This causes
non-range queries like
SELECT ... FROM ... WHERE keypart_1=const, ..., keypart_n=const
ORDER BY ... FOR UPDATE
to wait for a lock unneccesarily if another running transaction uses
SELECT ... FOR UPDATE on the same table.
Fixed by setting EQ_RANGE for all range accesses that represent
an equality predicate.
mysql-test/r/innodb_mysql.result:
bug#28570: Test Result
mysql-test/t/innodb_mysql.test:
bug#28570: Test Case
sql/handler.cc:
bug#28570: Updated comment
sql/opt_range.cc:
bug#28570: Removed the criterion that key has to be unique (HA_NOSAME) in
order for the EQ_RANGE flag to be set. It is sufficient that the range
represent a ref access.
ChangeSet@1.2575, 2007-08-07 19:16:06+02:00, msvensson@pilot.(none) +2 -0
Bug#26793 mysqld crashes when doing specific query on information_schema
- Drop the newly created user user1@localhost
- Cleanup testcase
mysql-test/r/ndb_bug26793.result:
mysql-test/r/ndb_bug26793.result@1.3, 2007-08-07 19:16:04+02:00, msvensson@pilot.(none)
+1 -6
Update test result
mysql-test/t/ndb_bug26793.test:
mysql-test/t/ndb_bug26793.test@1.3, 2007-08-07 19:16:04+02:00, msvensson@pilot.(none) +8
-11
- Remove the drop/restore of anonymous users - there are no such users
by default anymore(if there were, they would probably be in mysql.user)
- Switch back to default connection before cleanup
- Drop user1@localhost as part of cleanup
Write test results to var/log
Add test for "source" and variable expansion
client/mysqltest.c:
Improve error messages
Write .reject file to the location specified by --logdir
mysql-test/mysql-test-run.pl:
Pass logdir to mysqltest, to get test results written to var/log
mysql-test/r/mysqltest.result:
Update test results
mysql-test/t/mysqltest.test:
Add test for "source" and variable expansion
Update test after writing result in var/log
also fix "while" and "connect"
It's now possible to write "if("
client/mysqltest.c:
Don't require a space between for example "if" and "(". This should
also fix "while" and "connect"
mysql-test/t/mysqltest.test:
Remove space between if and ( to check it works
into pilot.(none):/data/msvensson/mysql/mysql-5.0-maint
client/mysqltest.c:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
mysql-test/r/mysqltest.result:
SCCS merged
client/mysqltest.c:
- Remove the extra newline first in the file produced by
write_file and append_file
- Add check for too many arguments passed to 'check_command_args'
mysql-test/r/mysqltest.result:
Update test result
mysql-test/t/mysqltest.test:
Add test to check that no extra newline is created
into bodhi.(none):/opt/local/work/mysql-5.0-runtime
mysql-test/r/federated.result:
Auto merged
mysql-test/t/federated.test:
Auto merged
sql/item.cc:
Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Twiddle the "replicaCount" and "fragCount" variable when restore data from different endian.
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Add byte order variable
ndb/tools/restore/Restore.cpp:
Twiddle blob, datatime,timestamp when do restore in different endian.
mysql-test/r/ndb_restore_different_endian_data.result:
Test case result for restore data from different endian
mysql-test/std_data/ndb_backup50_data_be/BACKUP-1-0.1.Data:
Test case data
mysql-test/std_data/ndb_backup50_data_be/BACKUP-1-0.2.Data:
Test case data
mysql-test/std_data/ndb_backup50_data_be/BACKUP-1.1.ctl:
Test case data
mysql-test/std_data/ndb_backup50_data_be/BACKUP-1.1.log:
Test case data
mysql-test/std_data/ndb_backup50_data_be/BACKUP-1.2.ctl:
Test case data
mysql-test/std_data/ndb_backup50_data_be/BACKUP-1.2.log:
Test case data
mysql-test/std_data/ndb_backup50_data_le/BACKUP-1-0.1.Data:
Test case data
mysql-test/std_data/ndb_backup50_data_le/BACKUP-1-0.2.Data:
Test case data
mysql-test/std_data/ndb_backup50_data_le/BACKUP-1.1.ctl:
Test case data
mysql-test/std_data/ndb_backup50_data_le/BACKUP-1.1.log:
Test case data
mysql-test/std_data/ndb_backup50_data_le/BACKUP-1.2.ctl:
Test case data
mysql-test/std_data/ndb_backup50_data_le/BACKUP-1.2.log:
Test case data
mysql-test/t/ndb_restore_different_endian_data.test:
Test case for restore data from different endian
under terms of bug#28875 for better performance.
The change appeared to require more changes in item_cmpfunc.cc,
which is dangerous in 5.0.
Conversion between a latin1 column and an ascii string constant
stopped to work.
mysql-test/r/ctype_recoding.result:
Adding test case.
mysql-test/t/ctype_recoding.test:
Adding test case.