Commit f47a0b9f authored by unknown's avatar unknown

Cleanup in libmysql.


libmysql/libmysql.c:
  Cleanup of conversion part of libmysql (prepared statements protocol):
  - now we have basic support for any conversion sequence:
    when we don't implement direct conversion of given value to requested 
    buffer type (i.e. time -> double, or the other way around) we
    first convert i.e. time -> string and then call string -> double 
    conversion.
    param->offset is now handled only in one place.
  - conversion functions renamed from send_data_{string, long, double}
    to fetch_{string,long,double}_with_conversion. Don't be confused
    with strange diff for send_data_long: I had to move send_data_string
    before all other sends as it's used inside thesm. (Shall we have
    a forward declaration instead?-)
  - a little cleanup in read_binary_{date,time,datetime} - now type of
    date value is set inside these functions, so we can be sure
    that we always return fully filled MYSQL_TIME structure to the user
  - float -> string conversion is fixed to honor param->precision. 
    This is a step forward in fixing bug#4172
tests/client_test.c:
  test fix: now libmysql always sets MYSQL_TIME::time_type field.
  We need to set these fields in the test as later _in values are compared
  with canonical by plain memcmp.
parent 61528cf2
This diff is collapsed.
......@@ -9862,11 +9862,17 @@ static void test_bug4026()
time_in.minute= 59;
time_in.second= 59;
time_in.second_part= 123456;
/*
This is not necessary, just to make assert below work: this field
is filled in when time is received from server
*/
time_in.time_type= MYSQL_TIMESTAMP_TIME;
datetime_in= time_in;
datetime_in.year= 2003;
datetime_in.month= 12;
datetime_in.day= 31;
datetime_in.time_type= MYSQL_TIMESTAMP_DATETIME;
mysql_stmt_bind_param(stmt, bind);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment