• unknown's avatar
    Fix for remaining issues described in Bug #1664 · 6ca75754
    unknown authored
    "mysql_send_long_data() API call is completely broken".
    
    Now we are resetting some members (long_data_supplied/null_value...) of Item_param to its 
    initial state after each execution of prepared statement. We also manipulating 
    Item_param::maybe_null/null_value only via Item_param::set_* setters which makes code a bit 
    more robust.
    
    
    sql/item.cc:
      Now we are assuming that Item_param may be NULL until we know this fact exactly.
      Added non-empty implementation of Item_param::reset() method which should be used
      for restoring Item_param state after each statment execution. (We need to clear 
      long_data_supplied flag, we also clear some other Item_param members here since it
      makes code simpler.)
    sql/item.h:
      Now Item_param::reset() method really does something.
    sql/sql_prepare.cc:
      Now we are calling Item_param::reset() for each parameter after execution for resetting Item_param
      to initial state. So we no longer don't need Prepared_statement::long_data_flag. We also 
      set Item_param::null_value/maybe_null value in Item_param::set_* and reset() methods 
      instead of doing it explicitly in insert_params_* functions (this by the way lowers 
      probability that we will forget to update one of such functions).
    tests/client_test.c:
      Added test for Bug#1664 "mysql_send_long_data() API call is broken".
    6ca75754
item.h 34.3 KB