mariadb/tests
Dmitry Shulga 9320dca994 Fixed Bug#11764168 "56976: SEVERE DENIAL OF SERVICE IN PREPARED STATEMENTS".
The problem was that server didn't check resulting size of prepared
statement argument which was set using mysql_send_long_data() API.
By calling mysql_send_long_data() several times it was possible
to create overly big string and thus force server to allocate
memory for it. There was no way to limit this allocation.

The solution is to add check for size of result string against
value of max_long_data_size start-up parameter. When intermediate
string exceeds max_long_data_size value an appropriate error message
is emitted.

We can't use existing max_allowed_packet parameter for this purpose
since its value is limited by 1GB and therefore using it as a limit
for data set through mysql_send_long_data() API would have been an
incompatible change. Newly introduced max_long_data_size parameter
gets value from max_allowed_packet parameter unless its value is
specified explicitly. This new parameter is marked as deprecated
and will be eventually replaced by max_allowed_packet parameter.
Value of max_long_data_size parameter can be set only at server
startup.


mysql-test/t/variables.test:
  Added checking for new start-up parameter max_long_data_size.
sql/item.cc:
  Added call to my_message() when accumulated string exceeds
  max_long_data_size value. my_message() calls error handler
  that was installed in mysql_stmt_get_longdata before call
  to Item_param::set_longdata.
  
  The error handler then sets state, last_error and last_errno
  fields for current statement to values which correspond to
  error which was caught.
sql/mysql_priv.h:
  Added max_long_data_size variable declaration.
sql/mysqld.cc:
  Added support for start-up parameter 'max_long_data_size'.
  This parameter limits size of data which can be sent from
  client to server using mysql_send_long_data() API.
sql/set_var.cc:
  Added variable 'max_long_data_size' into list of variables
  displayed by command 'show variables'.
sql/sql_prepare.cc:
  Added error handler class Set_longdata_error_handler.
  This handler is used to catch any errors that can be
  generated during execution of Item_param::set_longdata().
  
  Source code snippet that makes checking for statement's state 
  during statement execution is moved from Prepared_statement::execute()
  to Prepared_statement::execute_loop() in order not to call
  set_parameters() when statement has failed during
  set_long_data() execution. If this hadn't been done
  the call to set_parameters() would have failed.
tests/mysql_client_test.c:
  A testcase for the bug #56976 was added.
2011-03-15 17:36:12 +06:00
..
.cvsignore
auto_increment.res
auto_increment.tst
big_record.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
bug25714.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
CMakeLists.txt Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.1-build 2007-08-02 21:18:24 +02:00
connect_test.c Many files: 2006-12-23 20:17:15 +01:00
deadlock_test.c my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
drop_test.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
export.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
fork2_test.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
fork_big.pl Merge 2010-12-29 00:47:05 +01:00
fork_big2.pl Merge 2010-12-29 00:47:05 +01:00
function.res
function.tst
grant.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
grant.res Merge with 4.0.18 2004-02-11 00:06:46 +01:00
index_corrupt.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
insert_and_repair.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
insert_test.c Many files: 2006-12-23 20:17:15 +01:00
list_test.c Many files: 2006-12-23 20:17:15 +01:00
lock_test.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
lock_test.res
mail_to_db.pl This patch removes the remaining TYPE= code from MySQL. It cleans up a number of tests where it was being called still (and failing). Also I cleaned up all of the extra scripts so that they now work. 2006-02-12 13:26:30 -08:00
Makefile.am Merge 2010-12-29 00:47:05 +01:00
myisam-big-rows.tst
mysql_client_test.c Fixed Bug#11764168 "56976: SEVERE DENIAL OF SERVICE IN PREPARED STATEMENTS". 2011-03-15 17:36:12 +06:00
pmail.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
rename_test.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
restore-lock.smack
select_test.c Many files: 2006-12-23 20:17:15 +01:00
showdb_test.c Many files: 2006-12-23 20:17:15 +01:00
ssl_test.c Bug #15327: configure: --with-tcp-port option being partially ignored 2007-09-13 16:19:46 +02:00
table_types.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
test_delayed_insert.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
thread_test.c Merge mysql.com:/home/tnurnberg/15327/50-15327 2007-09-15 04:09:38 +02:00
truncate.pl - Added/updated copyright headers 2010-12-28 19:57:23 +01:00