diff options
author | Dmitry Shulga <Dmitry.Shulga@oracle.com> | 2011-03-15 18:57:36 +0600 |
---|---|---|
committer | Dmitry Shulga <Dmitry.Shulga@oracle.com> | 2011-03-15 18:57:36 +0600 |
commit | feb6d223285e91d435f3c72f2dc3f2b5e73c0f4a (patch) | |
tree | 0f5b82b368f0393b2467be245564bcd49d0933f9 /mysql-test | |
parent | f94e7288e33332584074ee85f625db9a93f2369c (diff) | |
parent | 9320dca994fdae18c549cb59266d49846dc1f839 (diff) | |
download | mariadb-git-feb6d223285e91d435f3c72f2dc3f2b5e73c0f4a.tar.gz |
Manual merge from mysql-5.1 for Bug#11764168 (56976: Severe denial
of service in prepared statements).
sql/sql_prepare.cc:
At mysql_stmt_get_longdata(): instead of pushing an internal
error handler (as done in 5.1-tree) we save, set and restore
the statement's diagnostics area and warning info.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/mysqld--help-notwin.result | 5 | ||||
-rw-r--r-- | mysql-test/r/mysqld--help-win.result | 5 | ||||
-rw-r--r-- | mysql-test/r/variables.result | 3 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/max_long_data_size_basic.result | 14 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/t/max_long_data_size_basic.test | 17 | ||||
-rw-r--r-- | mysql-test/t/variables.test | 5 |
6 files changed, 49 insertions, 0 deletions
diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 6659a291e0b..b4faa833c1b 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -309,6 +309,10 @@ The following options may be given as the first argument: max_join_size records return an error --max-length-for-sort-data=# Max number of bytes in sorted records + --max-long-data-size=# + The maximum BLOB length to send to server from + mysql_send_long_data API. Deprecated option; use + max_allowed_packet instead. --max-prepared-stmt-count=# Maximum number of prepared statements in the server --max-relay-log-size=# @@ -830,6 +834,7 @@ max-error-count 64 max-heap-table-size 16777216 max-join-size 18446744073709551615 max-length-for-sort-data 1024 +max-long-data-size 1048576 max-prepared-stmt-count 16382 max-relay-log-size 0 max-seeks-for-key 18446744073709551615 diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 240c29294e2..361d30620f7 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -308,6 +308,10 @@ The following options may be given as the first argument: max_join_size records return an error --max-length-for-sort-data=# Max number of bytes in sorted records + --max-long-data-size=# + The maximum BLOB length to send to server from + mysql_send_long_data API. Deprecated option; use + max_allowed_packet instead. --max-prepared-stmt-count=# Maximum number of prepared statements in the server --max-relay-log-size=# @@ -833,6 +837,7 @@ max-error-count 64 max-heap-table-size 16777216 max-join-size 18446744073709551615 max-length-for-sort-data 1024 +max-long-data-size 1048576 max-prepared-stmt-count 16382 max-relay-log-size 0 max-seeks-for-key 18446744073709551615 diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 5d6caf21182..96db86262c2 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1540,6 +1540,9 @@ ERROR HY000: Cannot drop default keycache SET @@global.key_cache_block_size=0; Warnings: Warning 1292 Truncated incorrect key_cache_block_size value: '0' +select @@max_long_data_size; +@@max_long_data_size +1048576 SET @@global.max_binlog_cache_size=DEFAULT; SET @@global.max_join_size=DEFAULT; SET @@global.key_buffer_size=@kbs; diff --git a/mysql-test/suite/sys_vars/r/max_long_data_size_basic.result b/mysql-test/suite/sys_vars/r/max_long_data_size_basic.result new file mode 100644 index 00000000000..679a0d3611f --- /dev/null +++ b/mysql-test/suite/sys_vars/r/max_long_data_size_basic.result @@ -0,0 +1,14 @@ +select @@global.max_long_data_size=20; +@@global.max_long_data_size=20 +0 +select @@session.max_long_data_size; +ERROR HY000: Variable 'max_long_data_size' is a GLOBAL variable +SELECT @@global.max_long_data_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_long_data_size'; +@@global.max_long_data_size = VARIABLE_VALUE +1 +set global max_long_data_size=1; +ERROR HY000: Variable 'max_long_data_size' is a read only variable +set session max_long_data_size=1; +ERROR HY000: Variable 'max_long_data_size' is a read only variable diff --git a/mysql-test/suite/sys_vars/t/max_long_data_size_basic.test b/mysql-test/suite/sys_vars/t/max_long_data_size_basic.test new file mode 100644 index 00000000000..eefa61bd4b7 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/max_long_data_size_basic.test @@ -0,0 +1,17 @@ +select @@global.max_long_data_size=20; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.max_long_data_size; + +# Show that value of the variable matches the value in the GLOBAL I_S table +SELECT @@global.max_long_data_size = VARIABLE_VALUE +FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES +WHERE VARIABLE_NAME='max_long_data_size'; + +# +# show that it's read-only +# +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global max_long_data_size=1; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session max_long_data_size=1; + diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 2b20bbdc13b..173f8aeaa58 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1281,6 +1281,11 @@ SET @@global.max_join_size=0; SET @@global.key_buffer_size=0; SET @@global.key_cache_block_size=0; +# +# Bug#56976: added new start-up parameter +# +select @@max_long_data_size; + # cleanup SET @@global.max_binlog_cache_size=DEFAULT; SET @@global.max_join_size=DEFAULT; |