1
0
mirror of https://github.com/MariaDB/server.git synced 2025-05-27 01:57:48 +03:00
Alexander Nozdrin 3fa437cf40 Fix for Bug#56934 (mysql_stmt_fetch() incorrectly fills MYSQL_TIME
structure buffer).

This is a follow-up for WL#4435. The bug actually existed not only
MYSQL_TYPE_DATETIME type. The problem was that Item_param::set_value()
was written in an assumption that it's working with expressions, i.e.
with basic data types.

There are two different quick fixes here:
  a) Change Item_param::make_field() -- remove setting of
     Send_field::length, Send_field::charsetnr, Send_field::flags and
     Send_field::type.

     That would lead to marshalling all data using basic types to the client
     (MYSQL_TYPE_LONGLONG, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_STRING and
     MYSQL_TYPE_NEWDECIMAL). In particular, that means, DATETIME would be
     sent as MYSQL_TYPE_STRING, TINYINT -- as MYSQL_TYPE_LONGLONG, etc.

     That could be Ok for the client, because the client library does
     reverse conversion automatically (the client program would see DATETIME
     as MYSQL_TIME object). However, there is a problem with metadata --
     the metadata would be wrong (misleading): it would say that DATETIME is
     marshaled as MYSQL_TYPE_DATETIME, not as MYSQL_TYPE_STRING.

  b) Set Item_param::param_type properly to actual underlying field type.
     That would lead to double conversion inside the server: for example,
     MYSQL_TIME-object would be converted into STRING-object
     (in Item_param::set_value()), and then converted back to MYSQL_TIME-object
     (in Item_param::send()).

     The data however would be marshalled more properly, and also metadata would
     be correct.

This patch implements b).

There is also a possibility to avoid double conversion either by clonning
the data field, or by storing a reference to it and using it on Item::send()
time. That requires more work and might be done later.
2010-11-13 18:05:02 +03:00
..
2010-08-16 14:50:27 +02:00
2010-07-25 19:30:18 +02:00
2010-05-24 14:51:59 +02:00
2010-10-28 12:08:09 +02:00
2010-05-28 19:53:26 -03:00
2010-03-31 16:05:33 +02:00
2010-07-30 16:56:57 +03:00
2010-08-13 14:20:49 +03:00
2010-09-09 16:43:45 +04:00
2010-10-06 13:02:11 +03:00
2010-08-30 11:36:04 +04:00
2010-08-30 11:36:04 +04:00
2010-10-07 12:17:08 +04:00
2010-03-31 16:05:33 +02:00
2010-10-23 21:09:27 +08:00
2010-09-29 17:26:32 +03:00
2010-11-09 12:45:13 -02:00
2010-09-16 16:20:35 +04:00
2010-06-11 10:15:55 +02:00
2010-04-13 19:04:45 +04:00
2010-10-16 22:20:35 +08:00
2010-03-31 16:05:33 +02:00
2010-09-06 17:04:32 +02:00
2010-10-12 14:07:13 +04:00
2010-10-23 21:09:27 +08:00
2010-10-23 21:09:27 +08:00
2010-10-23 21:09:27 +08:00
2010-08-31 13:59:51 +04:00
2010-10-28 12:08:09 +02:00
2010-09-27 16:55:09 +04:00
2010-08-26 14:17:27 +04:00
2010-08-12 20:44:41 +04:00
2010-11-02 16:02:16 +02:00
2009-09-10 03:18:29 -06:00
2010-10-04 15:42:16 +03:00
2009-12-03 21:37:38 +03:00