The server used to trust blindly information from the client about
its capabilities. During the connection handshake the server sends
information about what it supports and then the client sends back a
set of capabilities which cover all of the server's or less.
Before this changeset the server didn't check whether the flags sent
by the client were valid for the server. For example, if the server
doesn't support compressed protocol but the client does and sends that
bit turned on, the server didn't check it. The change make the server code
less error prone to problems related to the value of THD::client_capabilities.
Clearly there is no vulnerability being fixed but this is a maintainenance
fix to prevent misusage in the future.
include/mysql_com.h:
List all CLIENT flags in a common defition. Add also a definition
which excludes flags, which are optoinal.
sql/sql_connect.cc:
Renamed client_flags to server_capabilities to reflect what
the server supports. Only allow from the client the flags the
server supports.
into host.loc:/home/uchum/work/5.1-opt
sql/sql_show.cc:
Auto merged
mysql-test/r/information_schema.result:
Merge with 5.0-opt.
mysql-test/t/information_schema.test:
Merge with 5.0-opt.
Minor test case cleanup after bug#34529.
mysql-test/r/information_schema.result:
Minor test case cleanup after bug#34529.
mysql-test/t/information_schema.test:
Minor test case cleanup after bug#34529.
mysql-test/mysql-test-run.pl:
Group all code to find extra suites together
Fix problem with infinite loop by using splitdir to split the path
Use a hash to map clone name -> extr suite
sql/set_var.h:
Changing order of initializer list for sys_var class constructor to
eliminate compiler warning.
mysql-test/suite/binlog/combinations:
New BitKeeper file ``mysql-test/suite/binlog/combinations''
BUG#34790 - 'create server' doesn't handle out of memory scenario
well enough
This is an addition to fixes for these bugs, which makes gcov
happy.
mysql-test/r/federated.result:
CREATE SERVER is only tested by federated_server.test, which requires
big-test option. Added dummy test case to make gcov happy.
mysql-test/t/federated.test:
CREATE SERVER is only tested by federated_server.test, which requires
big-test option. Added dummy test case to make gcov happy.
sql/sql_parse.cc:
Make gcov happy.
if binlog_format=mixed
Addition to fix for BUG#34768: fixed test case failures discovered
by pushbuild.
mysql-test/suite/binlog/r/binlog_stm_ps.result:
Fixed binlog_stm_ps failure when binlog format is statement:
- this test case makes sence only if binlog format is statement,
thus execute it only in this mode;
- added a warning that insert ... select ... limit is not safe
to execute in statement mode.
mysql-test/suite/binlog/t/binlog_stm_ps.test:
Fixed binlog_stm_ps failure when binlog format is statement:
- this test case makes sence only if binlog format is statement,
thus execute it only in this mode;
- added a warning that insert ... select ... limit is not safe
to execute in statement mode.
mysql-test/suite/rpl/t/rpl_optimize.test:
rpl_optimize test may be executed in various binlog format modes.
In statement mode delete ... limit issues a warning, in mixed and
row modes it does not.
Fixed a test case so it is still possible to execute it in all binlog
format modes by ignoring delete ... limit warnings.
mysql-test/suite/rpl/t/rpl_user_variables.test:
rpl_user_variables test may be executed in various binlog format modes.
In statement mode insert ... select ... limit issues a warning,
in mixed and row modes it does not.
Fixed a test case so it is still possible to execute it in all binlog
format modes by ignoring insert ... select ... limit warnings.
localhost/default port
When creating federated table that points to unspecified host or
localhost on unspecified port or port is 0, small memory leak occurs.
This happens because we make a copy of unix socket path, which is
never freed.
With this fix we do not make a copy of unix socket path, instead
share->socket points to MYSQL_UNIX_ADDR constant directly.
This fix is covered by a test case for BUG34788.
Affects 5.0 only.
mysql-test/t/federated.test:
A test case for BUG#35509.
sql/ha_federated.cc:
When creating federated table we call parse_url() to check if connect
string is correct. parse_url() may make a copy of unix socket path if
port is not specified or 0 and host is not specified or 'localhost'.
This copy is never freed.
As there is no need to make a copy of unix socket path, let
share->socket point to MYSQL_UNIX_ADDR directly.
mysql_client_test causing a severe slowdown and increase
in memory usage, especially for test cases with long queries.
The solution is to enable the general log only in tests that
actually need the general log and disable it during the
execution of all other tests.
tests/mysql_client_test.c:
Selectively enable and disable the general log.
for YEAR data type.
The problem was that for some unknown reason 0 was not allowed
as a default value for YEAR data type. That was coded before BK.
However the Manual does not say a word about such a limitation.
Also, it looks inconsistent with other data types.
The fix is to allow 0 as a default value.
mysql-test/r/create.result:
Update result file.
mysql-test/t/create.test:
Add a test case for Bug#34274: Invalid handling of 'DEFAULT 0'
for YEAR data type.
sql/unireg.cc:
Allow 0 as a default value for YEAR data type.
mysql-test/r/information_schema_db.result:
Update result file.
mysql-test/r/sp-security.result:
Update result file.
mysql-test/r/trigger_notembedded.result:
Update result file.
mysql-test/r/view_grant.result:
Update result file.
bytes in unimportant, unused pieces of index pages) and test failure
because test requires Maria. Compiler warning.
About Valgrind error, two of the three bzero() added here are
needed to silence the error (the third is added for symmetry).
mysql-test/t/maria-gis-rtree.test:
requires Maria
storage/maria/ma_loghandler.c:
"uint64->uint16 possible loss of precision" on Windows
storage/maria/ma_rt_index.c:
We bzero the entire new page, as is done in _ma_enlarge_root()
for B-tree pages. This silences Valgrind warnings and allows
better compression.
storage/maria/ma_rt_split.c:
We bzero the entire new page, as is done in _ma_enlarge_root()
for B-tree pages. This silences Valgrind warnings and allows
better compression.
Fixed the parser to reject SQLSTATE '00000',
since '00000' is the successful completion condition,
and can not be caught by an exception handler in SQL.
mysql-test/r/sp-error.result:
Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal)
mysql-test/t/sp-error.test:
Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal)
sql/sp_pcontext.cc:
Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal)
into magare.gmz:/home/kgeorge/mysql/work/B26461-5.1-opt
CMakeLists.txt:
Auto merged
include/config-win.h:
Auto merged
include/my_global.h:
Auto merged
sql/procedure.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_acl.h:
Auto merged
sql/sql_analyse.cc:
Auto merged
sql/sql_analyse.h:
Auto merged
sql/sql_db.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/handler.h:
merged bug 26461 to 5.1-opt
sql/mysql_priv.h:
merged bug 26461 to 5.1-opt
sql/sql_base.cc:
merged bug 26461 to 5.1-opt
sql/sql_prepare.cc:
merged bug 26461 to 5.1-opt
The bool data type was redefined to BOOL (4 bytes on windows).
Removed the #define and fixed some of the warnings that were uncovered
by this.
Note that the fix also disables 2 warnings :
4800 : 'type' : forcing value to bool 'true' or 'false' (performance warning)
4805: 'operation' : unsafe mix of type 'type' and type 'type' in operation
These warnings will be handled in a separate bug, as they are performance related or bogus.
Fixed to int the return type of functions that return more than
2 distinct values.
CMakeLists.txt:
Bug #26461: disable the C4800 and C4805 warnings temporarily
include/config-win.h:
Bug #26461:
- no need for this define for Windows.
- windows C++ compilers have a bool type
include/my_global.h:
Bug #26461: removed bool_defined (no longer needed)
sql/handler.h:
Bug #26461: bool functions must return boolean values
sql/mysql_priv.h:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/procedure.h:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_acl.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_acl.h:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_analyse.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_analyse.h:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_base.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_db.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_delete.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_load.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_parse.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_prepare.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
sql/sql_update.cc:
Bug #26461: fixed return type of functions that return more than
2 distinct values.
correctly - crashes server !
Creating federated table with connect string containing empty
(zero-length) host name and port is evaluated as 0 (port is
incorrect, omitted or 0) crashes server.
This happens because federated calls strcmp() with NULL pointer.
Fixed by avoiding strcmp() call if hostname is set to NULL.
mysql-test/r/federated.result:
A test case for BUG#34788.
mysql-test/t/federated.test:
A test case for BUG#34788.
sql/ha_federated.cc:
Fixed that parse_url() may call strcmp() with NULL pointer.
A big test was written and is committed, which found 3 bugs in total:
- ALTER TABLE PAGE_CHECKSUM=0 sometimes had no effect
- ALTER TABLE ENGINE=MARIA sometimes changed page checksumming in
the table
- SHOW CREATE TABLE and 'maria_chk -dv' disagreed on the presence
of page checksumming.
They are all fixed here. Side-effect is that SHOW CREATE TABLE now
always prints a PAGE_CHECKSUM clause for Maria tables.
mysql-test/mysql-test-run.pl:
allow calling maria_chk and maria_pack in tests
mysql-test/r/maria.result:
PAGE_CHECKSUM=0 is now always printed
mysql-test/t/create.test:
PAGE_CHECKSUM= is now always present in SHOW CREATE TABLE of Maria tables
mysql-test/t/disabled.def:
better bug number
sql/sql_table.cc:
If ALTER TABLE PAGE_CHECKSUM=#, it affects the engine's data (structure
of data pages) so a full table rebuild is needed. We already did
so for ROW_FORMAT=#, following same logic. This fixes disagreements
between SHOW CREATE TABLE and 'maria_chk -dv' regarding the
presence of page checksums after certain ALTER TABLE (as seen
with the attached testcase).
storage/maria/ha_maria.cc:
In ALTER TABLE PAGE_CHECKSUM=0, ha_maria::update_create_info() started
with create_info->page_checksum=HA_CHOICE_NO and wrongly set it
to the table's original setting, which is HA_CHOICE_YES if the table
had page checksums, in which case the ALTER left page checksum
in the table.
The fix for this bug is: only if create_info->page_checksum is
undefined (no clause in the ALTER TABLE, or we are in SHOW CREATE TABLE)
we may set HA_CHOICE_YES.
The second bug in this file was that the code left HA_CHOICE_UNDEF if
the table didn't have page checksums originally, leading ALTER TABLE
ENGINE=MARIA to change the table's page checksum to the value of
maria_page_checksum.
This is fixed by setting create_info->page_checksum to HA_CHOICE_NO
if UNDEF and table does not have page checksum.
The side-effect of this last fix, because ha_maria::update_create_info()
is also called by SHOW CREATE TABLE, is that:
SET GLOBAL maria_page_checksum=0;
CREATE TABLE t(a INT) ENGINE=MARIA;
SHOW CREATE TABLE t;
which used to not show a PAGE_CHECKSUM= clause, now shows PAGE_CHECKSUM=0.
I consider this side-effect good:
- clearer for users: it eliminates the differences between the
above and this:
SET GLOBAL maria_page_checksum=0;
CREATE TABLE t(a INT) ENGINE=MARIA PAGE_CHECKSUM=0;
SHOW CREATE TABLE t;
which already showed PAGE_CHECKSUM=0; difference which is not easy
to explain.
- if using mysqldump to copy from one server to another, it eliminates
the dependency on the value of maria_page_checksum being the same on
original server and new server.
mysql-test/r/maria-page-checksum.result:
Result. If you undo the code fixes and run the test, the new result
file will show bugs at:
error lineno 56 : expected PAGE_CHECKSUM=1, got Page checksums are not used
error lineno 73 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
error lineno 110 : expected PAGE_CHECKSUM=1, got Page checksums are not used
error lineno 164 : expected PAGE_CHECKSUM=1, got Page checksums are not used
error lineno 181 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
error lineno 218 : expected PAGE_CHECKSUM=1, got Page checksums are not used
error lineno 253 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
error lineno 307 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
error lineno 361 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
error lineno 415 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
error lineno 488 : expected PAGE_CHECKSUM=1, got Page checksums are not used
error lineno 505 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
error lineno 542 : expected PAGE_CHECKSUM=1, got Page checksums are not used
error lineno 577 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
error lineno 631 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
(lineno is line number in the result file)
mysql-test/t/maria-page-checksum.test:
Test for the 3 bugs
into stella.local:/home2/mydev/mysql-5.1-axmrg
mysql-test/r/partition_not_windows.result:
Auto merged
mysql-test/r/partition_symlink.result:
Auto merged
mysql-test/r/symlink.result:
Auto merged
mysql-test/suite/parts/r/partition_basic_innodb.result:
Auto merged
mysql-test/suite/parts/r/partition_basic_myisam.result:
Auto merged
sql/log_event.cc:
Auto merged
sql/partition_info.cc:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/t/partition_symlink.test:
Manual merge
mysql-test/t/symlink.test:
Manual merge
sql/sql_parse.cc:
Manual merge