a non-correlated single-row subquery over information schema.
The function get_all_tables filling all information schema
tables reset lex->sql_command to SQLCOM_SHOW_FIELDS. After
this the function could evaluate partial conditions related to
some columns. If these conditions contained a subquery over
information schema it led to a wrong evaluation and a wrong
result set.
This bug was already fixed in 5.1.
This patch follows the way how it was done in 5.1 where
the value of lex->sql_command is set to SQLCOM_SHOW_FIELDS
in get_all_tables only for the calls of the function
open_normal_and_derived_tables and is restored after these
calls.
mysql-test/r/information_schema.result:
Added a test case for bug #21231.
mysql-test/t/information_schema.test:
Added a test case for bug #21231.
Make mysqlcheck skip over views when processing all of the tables in a
database.
client/mysqlcheck.c:
Use SHOW TABLE STATUS to get table list, and skip over things that don't
have an engine (like a VIEW).
mysql-test/r/mysqlcheck.result:
Add new results
mysql-test/t/mysqlcheck.test:
Add new regression test
- Send confusing output to /dev/null
mysql-test/t/mysqlbinlog.test:
Send confusing error messages to /dev/null so they don't appear in erro log if test case fails
- Add test case(execute perror)
- Check if strerror has returned NULL and set msg to "Unknown Error" in that case
- Thanks to Steven Xie for pointing out how to fix.
extra/perror.c:
strerror might return NULL on Solaris 2.8
mysql-test/mysql-test-run.pl:
Add possibility to execute perror from test case
mysql-test/r/have_perror.require:
New BitKeeper file ``mysql-test/r/have_perror.require''
mysql-test/r/perror.result:
New BitKeeper file ``mysql-test/r/perror.result''
mysql-test/t/perror.test:
New BitKeeper file ``mysql-test/t/perror.test''
into trift2.:/M50/merge-4.1-to-5.0
VC++Files/libmysqld/libmysqld.dsp:
Auto merged
VC++Files/libmysqld/libmysqld.vcproj:
Auto merged
VC++Files/libmysqld/libmysqld_ia64.dsp:
Auto merged
VC++Files/mysqldemb/mysqldemb.dsp:
Auto merged
VC++Files/sql/mysqld.dsp:
Auto merged
VC++Files/sql/mysqld.vcproj:
Auto merged
VC++Files/sql/mysqld_ia64.dsp:
Auto merged
VC++Files/sql/mysqldmax.dsp:
Auto merged
sql/field.cc:
Merge a backport == Null-merge == "ul".
sql/field.h:
Merge a backport == Null-merge == "ul".
sql/sql_locale.cc:
Changes were already present (and even better) == Null-merge == "ul".
into trift2.:/M50/merge-4.1-to-5.0
strings/strtod.c:
Manual merge: Null merge with header file cleanup ("my_base.h" includes "my_global.h", so we do not need both).
into trift2.:/M50/merge-4.1-to-5.0
mysql-test/r/date_formats.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_locale.cc:
Auto merged
sql/item_timefunc.cc:
Merging by "ul", as asked in the original changeset.
support-files/mysql.spec.sh:
Manual merge, keeping alphabetic order.
- The mysql-test/std_data/bug15328.cnf file was not copied to install or dist dir.
mysql-test/Makefile.am:
Add std_data/*.cnf files to dist_hook and install-data-local
scripts/make_win_src_distribution.sh:
Copy *.cnf files as well.
CREATE PROCEDURE
The bug was fixed already. This changeset adds a test case.
mysql-test/r/sp-error.result:
Add result for bug#14702: misleading error message when syntax error
in CREATE PROCEDURE.
mysql-test/t/sp-error.test:
Add test case for bug#14702: misleading error message when syntax error
in CREATE PROCEDURE.
- Add call to 'safe_exit' function when db query fails.
client/mysqldump.c:
Add a call to 'safe_exit' to remember the error code and exit unless --force was give.n
mysql-test/r/mysqldump.result:
Add test result
mysql-test/t/mysqldump.test:
Add test case
when calling a SP from C API"
The bug was caused by lack of checks for misuse in mysql_real_query.
A stored procedure always returns at least one result, which is the
status of execution of the procedure itself.
This result, or so-called OK packet, is similar to a result
returned by INSERT/UPDATE/CREATE operations: it contains the overall
status of execution, the number of affected rows and the number of
warnings. The client test program attached to the bug did not read this
result and ivnoked the next query. In turn, libmysql had no check for
such scenario and mysql_real_query was simply trying to send that query
without reading the pending response, thus messing up the communication
protocol.
The fix is to return an error from mysql_real_query when it's called
prior to retrieval of all pending results.
client/mysqlbinlog.cc:
net_safe_read -> cli_safe_read
include/mysql.h:
Remove a private function from the public header.
include/mysql_com.h:
Remove a define that is never used.
include/sql_common.h:
Add a declaration for cli_safe_read - a function that reads one packet
from the server.
libmysql/libmysql.c:
net_safe_read -> cli_safe_read
Return CR_COMMANDS_OUT_OF_SYNC on attempt to execute a statement
using a connection which has pending result sets.
sql-common/client.c:
Actual fix for Bug#15752: if the server has pending result sets for
the client, return CR_COMMANDS_OUT_OF_SYNC on attempt to execute
another query. Similarly to the behaviour of mysql_use_result(),
multiple result sets block the connection and must be fetched
before it can be used for another query.
This uncovered an error in the protocol: the server doesn't drop
SERVER_MORE_RESULTS_EXISTS status flag upon an error, so in case of
a multi-query like SELECT 1; SELECT syntax_error; SELECT 2;
the client has no way to know that the server won't ever come to
execution of the third query and won't return any result sets for it.
For now, fix it in cli_safe_read, as a proper fix requires extension
of the client-server protocol.
sql/protocol.cc:
Remove a name that is never used.
sql/slave.cc:
net_safe_read -> cli_safe_read
tests/mysql_client_test.c:
Make 'query' a local variable to avoid name clash.
Add a test case for Bug#15752 "Lost connection to MySQL server when
calling an SP from C API"
- Add printout in write_footer to tell that mysqldump has completed.
Ex: -- Dump completed 2006-07-24 8:55:05
client/Makefile.am:
Build mysqldump with mf_getdate.c
client/mysqldump.c:
Add printout in write_footer that will print info that mysqldump has completed
Filter out strange control characters, messes up logs
netware/BUILD/mwasmnlm:
Filter out strange control characters, messes up logs
netware/BUILD/mwccnlm:
Filter out strange control characters, messes up logs
netware/BUILD/mwldnlm:
Filter out strange control characters, messes up logs
mysql-test/r/delete.result:
Fix for bug #8143: A date with value 0 is treated as a NULL value
- test result
mysql-test/t/delete.test:
Fix for bug #8143: A date with value 0 is treated as a NULL value
- test case
sql/sql_delete.cc:
Fix for bug #8143: A date with value 0 is treated as a NULL value
- during SELECT queries processing we convert 'date[time]_field is null'
conditions into 'date[time]_field = 0000-00-00[ 00:00:00]' for not null
DATE and DATETIME fields. To be consistent, we have to do the same for DELETE
queries. So we should call remove_eq_conds() in the mysql_delete() as well.
Also it may simplify and speed up DELETE queries execution.
into mysql.com:/usr/home/ram/work/5.0.b10966
mysql-test/r/func_group.result:
Auto merged
mysql-test/t/func_group.test:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_sum.h:
Auto merged
subqueries on information schema that use MIN/MAX aggregation.
Execution of some correlated subqueries may set the value
of null_row to 1 for tables used in the subquery.
If the the subquery is on information schema it causes
rejection of any row for the following executions of
the subquery in the case when an optimization filtering
by some condition is applied.
The fix restores the value of the null_row flag for
each execution of a subquery on information schema.
mysql-test/r/information_schema.result:
Added a test case for bug #18925.
mysql-test/t/information_schema.test:
Added a test case for bug #18925.
sql/sql_show.cc:
Fixed bug #18925.
Execution of some correlated subqueries may set the value
of null_row to 1 for tables used in the subquery.
If the the subquery is on information schema it causes
rejection of any row for the following execitions of
the subquery in the case when an optimization filtering
by some condition is applied.
The fix restores the value of the null_row flag for
each execution of a subquery on information schema.
When a wildcard database name is given the mysqlshow, but that wildcard
matches one database *exactly* (it contains the wildcard character), we
list the contents of that database instead of just listing the database
name as matching the wildcard. Probably the most common instance of users
encountering this behavior would be with "mysqlshow information_schema".
client/mysqlshow.c:
Add special handling for listing a single database that has a name that
looked like it contained wildcards. In this case, we just go ahead and list
the contents of the database, since there is a very high probability that is
what the user really wanted to do. (For example, 'mysqlshow INFORMATION_SCHEMA'
will show the I_S tables instead of just the I_S database.)
mysql-test/r/mysqlshow.result:
Add new results
mysql-test/t/mysqlshow.test:
Add new regression test
Place mysqlmanager 'pdb' file in 'client_debug' directory
mysys.vcproj:
Removed define of __NT__ from 'Debug' target
mysqld.vcproj:
Always generate 'pdb' and 'map' files
server-tools/instance-manager/mysqlmanager.vcproj:
Place mysqlmanager 'pdb' file in 'client_debug' directory
VC++Files/mysys/mysys.vcproj:
Removed define of __NT__ from 'Debug' target
VC++Files/sql/mysqld.vcproj:
Always generate 'pdb' and 'map' files
into moonbone.local:/work/autopush/12185-bug-5.0-opt-mysql
mysql-test/r/create.result:
Auto merged
mysql-test/t/innodb.test:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/item.cc:
Auto merged
mysql-test/r/union.result:
SCCS merged
mysql-test/t/union.test:
SCCS merged