mariadb/tests
Alexander Barkov 563f1d894b MDEV-14454 Binary protocol returns wrong collation ID for SP OUT parameters
Item_param::set_value() did not set Item::collation and
Item_param::str_value_ptr.str_charset properly. So both
metadata and data for OUT parameters were sent in a wrong
way to the client.

This patch removes the old implementation of Item_param::set_value()
and rewrites it using Type_handler::Item_param_set_from_value(),
so now setting IN and OUT parameters share the a lot of code.

1. Item_param::set_str() now:
  - accepts two additional parameters fromcs, tocs
  - sets str_value_ptr, to make sure it's always in sync with str_value,
    even without Item_param::convert_str_value()
  - does collation.set(tocs, DERIVATION_COERCIBLE),
    to make sure that DTCollation is valid even without
    Item_param::convert_str_value()

2. Item_param::set_value(), which is used to set OUT parameters,
   now reuses Type_handler::Item_param_set_from_value().

3. Cleanup: moving Item_param::str_value_ptr to private,
   as it's not needed outside.

4. Cleanup: adding a new virtual method
   Settable_routine_parameter::get_item_param()
   and using it a few new DBUG_ASSERTs, where
   Item_param cannot appear.

After this change:
1. Assigning of IN parameters works as before:
a. Item_param::set_str() is called and sets the value as a binary string
b. The original value is sent to the query used for binary/general logging
c. Item_param::convert_str_value() converts the value from the client
   character set to the connection character set

2. Assigning of OUT parameters works in the new way:
a. Item_param::set_str() and sets the value
   using the source Item's collation, so both Item::collation
   and Item_param::str_value_ptr.str_charset are properly set.
b. Protocol_binary::send_out_parameters() sends the
   value to the client correctly:
   - Protocol::send_result_set_metadata() uses Item::collation.collation
     (which is now properly set), to detect if conversion is needed,
     and sends a correct collation ID.
   - Protocol::send_result_set_row() calls Type_handler::Item_send_str(),
     which uses Item_param::str_value_ptr.str_charset
     (which is now properly set) to actually perform the conversion.
2017-11-21 16:02:26 +04:00
..
async_queries.c Merge branch '5.5' into 10.0 2016-09-27 09:21:19 +02:00
auto_increment.res
auto_increment.tst
big_record.pl Updated/added copyright headers 2011-06-30 17:46:53 +02:00
bug25714.c Fixes to get all test to run on MacosX Lion 10.7 2015-11-29 17:51:23 +02:00
check_async_queries.pl MWL#192: Non-blocking client API for libmysqlclient. 2011-09-20 12:49:25 +02:00
CMakeLists.txt Add C/C as a submodule in libmariadb/ 2016-09-12 17:46:35 +02:00
connect_test.c Updated/added copyright headers 2014-01-06 10:52:35 +05:30
consistent_snapshot.pl MWL#116: Efficient group commit: PBXT part 2010-10-15 15:42:06 +02:00
deadlock_test.c Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
drop_test.pl Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
export.pl Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
fork2_test.pl Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
fork_big.pl Fixed some bugs in fork_big.pl which caused some tests to die early 2017-05-05 18:25:35 +03:00
fork_big2.pl mysql-5.5.41 merge 2014-12-19 11:35:44 +01:00
function.res
function.tst
grant.pl Initail merge with MySQL 5.1 (XtraDB still needs to be merged) 2011-11-21 19:13:14 +02:00
grant.res
index_corrupt.pl Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
insert_and_repair.pl Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
insert_test.c Updated/added copyright headers 2014-01-06 10:52:35 +05:30
list_test.c Updated/added copyright headers 2014-01-06 10:52:35 +05:30
lock_test.pl Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
lock_test.res
mail_to_db.pl
myisam-big-rows.tst A follow-up on WL#5154 and WL#5182: remove forgotten options. 2010-03-03 22:22:02 +03:00
mysql_client_fw.c MDEV-14454 Binary protocol returns wrong collation ID for SP OUT parameters 2017-11-21 16:02:26 +04:00
mysql_client_test.c MDEV-14454 Binary protocol returns wrong collation ID for SP OUT parameters 2017-11-21 16:02:26 +04:00
nonblock-wrappers.h After-review changes 2016-09-12 17:51:50 +02:00
pmail.pl Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
rename_test.pl Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
restore-lock.smack
select_test.c Updated/added copyright headers 2014-01-06 10:52:35 +05:30
showdb_test.c Updated/added copyright headers 2014-01-06 10:52:35 +05:30
ssl_test.c Updated/added copyright headers 2014-01-06 10:52:35 +05:30
table_types.pl Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
test_delayed_insert.pl Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
thread_test.c mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
truncate.pl Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30