mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
563f1d894b
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. |
||
---|---|---|
.. | ||
async_queries.c | ||
auto_increment.res | ||
auto_increment.tst | ||
big_record.pl | ||
bug25714.c | ||
check_async_queries.pl | ||
CMakeLists.txt | ||
connect_test.c | ||
consistent_snapshot.pl | ||
deadlock_test.c | ||
drop_test.pl | ||
export.pl | ||
fork2_test.pl | ||
fork_big.pl | ||
fork_big2.pl | ||
function.res | ||
function.tst | ||
grant.pl | ||
grant.res | ||
index_corrupt.pl | ||
insert_and_repair.pl | ||
insert_test.c | ||
list_test.c | ||
lock_test.pl | ||
lock_test.res | ||
mail_to_db.pl | ||
myisam-big-rows.tst | ||
mysql_client_fw.c | ||
mysql_client_test.c | ||
nonblock-wrappers.h | ||
pmail.pl | ||
rename_test.pl | ||
restore-lock.smack | ||
select_test.c | ||
showdb_test.c | ||
ssl_test.c | ||
table_types.pl | ||
test_delayed_insert.pl | ||
thread_test.c | ||
truncate.pl |