• unknown's avatar
    Data truncation reporting implementation (libmysql) + post review · 7845f99a
    unknown authored
    fixes. Still to do: 
    -  deploy my_strtoll10 in limbysql.c
    - add mysql_options option to switch MYSQL_DATA_TRUNCATED on and off.
    
    
    include/my_time.h:
      More calls are shared between client and server (libmysql now performs
      more intelligent date->number and number->date conversions).
      TODO: rename those which are not starting with 'my_'
    include/mysql.h:
      MYSQL_BIND:
      - more elaborated comment
      - some of the ex-private members were given public names - 
        it's sometimes convenient to set bind->error to &bind->error_value.
        However Monty questions the idea, so it should be given
        more thought in future.
      - added new members to support data truncation.
      Added new return value of mysql_stmt_fetch, MYSQL_DATA_TRUNCATED.
    libmysql/libmysql.c:
      - added support for data truncation during fetch
      - implementation for is_binary_compatible: now conversion functions
        are used less frequently
      - we now use number_to_datetime and TIME_to_ulonglong for date->number and
        number->date conversions
    sql-common/my_time.c:
      - added implementation of date->number and number->date calls shared 
        between client and server (moved from time.cc).
    sql/field.cc:
      - implemented Field_time::store_time() to better support date->time
        conversions in prepared mode. After-review fixes.
    sql/field.h:
      - Field::store_time now returns int
    sql/mysql_priv.h:
      - removed date->number and number->date conversion functions headers
        (moved to my_time.h)
    sql/time.cc:
      - removed implementation of date->number and number->date conversion
        functions (moved to my_time.c)
    tests/client_test.c:
      - added a test case for data truncation; other test cases adjusted.
      - fixed my_process_stmt_result to set STMT_ATTR_UPDATE_MAX_LENGTH (tables
        are now printed out prettier).
    7845f99a
my_time.h 3.05 KB