1. 04 Oct, 2006 1 commit
    • unknown's avatar
      Fixes a number of problems with time/datetime <-> string conversion functions: · f29045b4
      unknown authored
      - bug #11655 "Wrong time is returning from nested selects - maximum time exists
      - input and output TIME values were not validated properly in several conversion functions
      - bug #20927 "sec_to_time treats big unsigned as signed"
      - integer overflows were not checked in several functions. As a result, input values like 2^32 or 3600*2^32 were treated as 0
      - BIGINT UNSIGNED values were treated as SIGNED in several functions
      - in cases where both input string truncation and out-of-range TIME value occur, only 'truncated incorrect time value' warning was produced
      
      
      include/my_time.h:
        Added defines for the TIME limits
        Added defines for the warning flags set by str_to_time() and check_time_range()
        Added check_time_range() declaration
      mysql-test/r/func_sapdb.result:
        Fixed testcases which relied on incorrect TIMEDIFF() behaviour
      mysql-test/r/func_time.result:
        Fixed testcase which relied on incorrect behaviour
        Added testcases for out-of-range values in SEC_TO_TIME(), TIME_TO_SEC(), ADDTIME(), SUBTIME() and EXTRACT()
      mysql-test/t/func_time.test:
        Added testcases for out-of-range values in SEC_TO_TIME(), TIME_TO_SEC(), ADDTIME(), SUBTIME() and EXTRACT()
      sql-common/my_time.c:
        Added check_time_range() to be used from str_to_time() and item_timefunc.cc
        Added new out-of-range flag to str_to_time() warnings
        Use '%u' instead of '%d' in my_*_to_str() because the arguments are unsigned
      sql/field.cc:
        Replaced out-of-range checks with checks for flags returned by str_to_time()
      sql/item_timefunc.cc:
        Added wrappers over make_datetime() and make_time() which perform out-of-range checks on input values
        Moved common code in Item_func_sec_to_time::val_str() and Item_func_sec_to_time::val_int() into a separate function sec_to_time()
        Replaced calls to make_datetime() with make_datetime_with_warn() in Item_func_add_time and Item_func_timediff
        Checks for 'unsigned int' overflows in Item_func_maketime
        Use make_time_with_warn() instead of make_time() in Item_func_maketime
        Fixed incorrect sizeof() in Item_func_str_to_date::get_time()
      sql/time.cc:
        Check for return value of str_to_time() along with warning flags
      f29045b4
  2. 14 Aug, 2006 1 commit
    • unknown's avatar
      Removed warnings for Windows build issues. Edited Windows README to remove reference to BDB. · 63e2e5c1
      unknown authored
      libmysqld/CMakeLists.txt:
        Fix for build for BDB
      mysys/base64.c:
        Removed warning
      mysys/my_pread.c:
        Removed warning
      sql-common/my_time.c:
        Removed Warning
      sql/CMakeLists.txt:
        Editing for BDB
      storage/csv/ha_tina.cc:
        Removed warning
      storage/myisam/ft_parser.c:
        Removed warning
      storage/myisam/mi_delete_all.c:
        Removed unused variable
      storage/myisam/mi_packrec.c:
        Removed unused variable
      win/README:
        Fixed docs on Windows BDB
      win/configure.js:
        Removed function call to add support for building BDB
      63e2e5c1
  3. 12 Jul, 2006 1 commit
    • unknown's avatar
      Fix for bug #19370: DateTime datatype in MySQL has two bugs in it · 1446f9b4
      unknown authored
      mysql-test/r/date_formats.result:
        Fix for bug #19370: DateTime datatype in MySQL has two bugs in it
          - results adjusted
      mysql-test/r/strict.result:
        Fix for bug #19370: DateTime datatype in MySQL has two bugs in it
          - results adjusted
      mysql-test/r/type_datetime.result:
        Fix for bug #19370: DateTime datatype in MySQL has two bugs in it
          - results adjusted
      mysql-test/t/strict.test:
        Fix for bug #19370: DateTime datatype in MySQL has two bugs in it
          - tests adjusted
      sql-common/my_time.c:
        Fix for bug #19370: DateTime datatype in MySQL has two bugs in it
          - Regardless of the title of the bug the only real bug is that it
            doesn't make sense to have only some invalid parts in a date.
            E.g. a valid day among invalid years or months is totally ambiguous 
            and we should refuse to guess what it means.
        
            To fix it, we add a check that both the year is zero and either day
            or month are zero (year and (day or month)), and if they are then  we
            reject such dates. Doing so should adequately fix the reported problem.
      1446f9b4
  4. 16 May, 2006 1 commit
    • unknown's avatar
      Bug#18997: DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value · 6792c154
      unknown authored
      if input year for date_add() / date_sub() with INTERVAL is low enough for
      calc_daynr() to possibly return incorrect results (calc_daynr() has no information
      on whether the year is low because it was a two-digit year ('77) or because it
      was a really low four-digit year (0077) and will indiscriminately try to turn the
      value into a four-digit year by adding 1900 or 2000 respectively), the functions
      will now throw NULL.
      
      
      include/my_time.h:
        new define YY_MAGIC_BELOW: if year is below this threshold, magic kicks in in
        calc_daynr(). the idea is to convert two-digit years to four-digit ones, adding
        1900 to values >= YY_PART_YEAR or adding 2000 otherwise.
        current value of YY_MAGIC_BELOW derived from original code in calc_daynr()
      mysql-test/r/func_time.result:
        test where 2 digit -> 4 digit year magic kicks in, and whether we throw NULL when
        it happens
      mysql-test/t/func_time.test:
        test where 2 digit -> 4 digit year magic kicks in, and whether we throw NULL when
        it happens
      sql-common/my_time.c:
        use new const YY_MAGIC_BELOW, apply 2-digit -> 4-digit magic only to years
        below this threshold.
      sql/item_timefunc.cc:
        throw NULL when year in date_add() / date_sub() would be affected by
        2 digit -> 4 digit magic.
      6792c154
  5. 15 Dec, 2005 1 commit
    • unknown's avatar
      Fixed BUG #12440: "Incorrect processing of time values containing · 3d6179e7
      unknown authored
       long fraction and/or large exponent part".
      
      
      mysql-test/r/type_time.result:
        Fixed testcases results (bug #12440)
      mysql-test/t/type_time.test:
        Added testcases for bug #12440
      sql-common/my_time.c:
        Fixed bug #12440: "Incorrect processing of time values containing
         long fraction and/or large exponent part".
         Modified str_to_time(). Process properly fraction part containing
         more than 6 digits. Check for existence of exponent part which
         may result from %g formatting applied to time value specified as
         large real number.
      3d6179e7
  6. 08 Aug, 2005 1 commit
    • unknown's avatar
      Review of new pushed code · 62011d16
      unknown authored
      - Fixed some error condtion when handling dates with 'T'
      - Added extra test for bug #11867 (Wrong result with "... WHERE ROW( a, b ) IN ( SELECT DISTINCT a, b WHERE ...)" to show it's not yet fixed
      - Safety fixes and cleanups
      
      
      mysql-test/r/subselect.result:
        Added extra test case to test case for bug #11867
        (Result shows that current code is not yet right and needs to be fixed)
      mysql-test/r/type_datetime.result:
        More tests for dates of type CCYYMMDDTHHMMSS
      mysql-test/t/subselect.test:
        Added extra test case to test case for bug #11867
      mysql-test/t/type_datetime.test:
        More tests for dates of type CCYYMMDDTHHMMSS
      sql-common/my_time.c:
        Fixed handling of dates of type CCYYMMDDTHHMMSS
        (Old code couldn't handle 2003-0304 or 2003-0003-02)
      sql/slave.cc:
        Indentation cleanup
      sql/sql_parse.cc:
        Added test of return value of get_system_var()
      sql/sql_select.cc:
        Removed unnecessary call to field->table->maybe_null
      sql/sql_union.cc:
        Indentation fixes
      62011d16
  7. 02 Aug, 2005 1 commit
  8. 31 Jul, 2005 1 commit
    • unknown's avatar
      Fixes during review of new pushed code · f5589f21
      unknown authored
      Change bool in C code to my_bool
      Added to mysqltest --enable_parsning and --disable_parsing to avoid to have to comment parts of tests
      Added comparison of LEX_STRING's and use this to compare file types for view and trigger files.
      
      
      client/client_priv.h:
        Added OPT_TRIGGERS (to get rid of compiler warning)
      client/mysql.cc:
        Added cast to get rid of compiler warning
      client/mysqldump.c:
        Added OPT_TRIGGERS (to get rid of compiler warning)
        Abort if we can't write to outfile (even if --ignore-errors is given)
      client/mysqltest.c:
        Added --enable_parsning and --disable_parsing to avoid to have to comment parts of tests
      include/my_sys.h:
        Make my_progname const
      include/my_time.h:
        Avoid using 'bool' in C programs
      mysql-test/lib/init_db.sql:
        Align with mysql_create_system_tables
        (Ideally this file should be auto-generated from the above script)
      mysql-test/r/mysqltest.result:
        Test for --enable_parsing
      mysql-test/r/variables.result:
        Update results after fix for ...
      f5589f21
  9. 18 Jul, 2005 1 commit
    • unknown's avatar
      Fix number to date conversion so it always honors the NO_ZERO_DATE, · 8eb64433
      unknown authored
      NO_ZERO_IN_DATE, and INVALID_DATES bits of SQL_MODE. (Bug #5906)
      
      
      include/my_time.h:
        Pass flags to number_to_datetime() so it can check things
        like NO_ZERO_DATE.
      libmysql/libmysql.c:
        Enable fuzzy date handling when converting strings and numbers
        to datetime fields.
      mysql-test/r/ps_2myisam.result:
        Update results
      mysql-test/r/ps_3innodb.result:
        Update results
      mysql-test/r/ps_4heap.result:
        Update results
      mysql-test/r/ps_5merge.result:
        Update results
      mysql-test/r/ps_6bdb.result:
        Update results
      mysql-test/r/ps_7ndb.result:
        Update results
      mysql-test/r/strict.result:
        Update results
      mysql-test/r/timezone2.result:
        Update results
      mysql-test/r/type_datetime.result:
        Update results
      mysql-test/t/strict.test:
        Add new regression test
      mysql-test/t/timezone2.test:
        Add new test of timestamp values in DST gap
      sql-common/my_time.c:
        Expand check_date() to check NO_ZERO_DATE and NO_ZERO_IN_DATE, and
        use it from number_to_datetime() as well as str_to_datetime(). Also,
        make number_to_datetime() return -1 on error so we can distinguish
        between a violation of NO_ZERO_DATE and other errors.
      sql/field.cc:
        Update conversion of numbers to date, datetime, and timestamp to
        use number_to_datetime() and report errors and warnings correctly
        and consistently.
      8eb64433
  10. 04 Jan, 2005 1 commit
  11. 30 Dec, 2004 1 commit
    • unknown's avatar
      Merged fixes for bug #7297 "Two digit year should be interpreted · fd9008c6
      unknown authored
      correctly even with zero month and day" and bug #7515 "from_unixtime(0)
      now returns NULL instead of the Epoch" into 4.1 tree.
      
      
      mysql-test/r/ps_2myisam.result:
        Updated test result after merging fix for bug #7297 "Two digit year should
        be interpreted correctly even with zero month and day" into 4.1
      mysql-test/r/ps_3innodb.result:
        Updated test result after merging fix for bug #7297 "Two digit year should
        be interpreted correctly even with zero month and day" into 4.1
      mysql-test/r/ps_4heap.result:
        Updated test result after merging fix for bug #7297 "Two digit year should
        be interpreted correctly even with zero month and day" into 4.1
      mysql-test/r/ps_5merge.result:
        Updated test result after merging fix for bug #7297 "Two digit year should
        be interpreted correctly even with zero month and day" into 4.1
      mysql-test/r/ps_6bdb.result:
        Updated test result after merging fix for bug #7297 "Two digit year should
        be interpreted correctly even with zero month and day" into 4.1
      mysql-test/r/ps_7ndb.result:
        Updated test result after merging fix for bug #7297 "Two digit year should
        be interpreted correctly even with zero month and day" into 4.1
      sql-common/my_time.c:
        Merged fix for bug #7297 "Two digit year should be interpreted correctly
        even with zero month and day" into 4.1
      sql/item_timefunc.cc:
        Small fix after merging patch solving bug #7515 "from_unixtime(0) now
        returns NULL instead of the Epoch" into 4.1.
      fd9008c6
  12. 16 Dec, 2004 1 commit
    • unknown's avatar
      Data truncation reporting implementation (libmysql) + post review · d2d33183
      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).
      d2d33183
  13. 15 Nov, 2004 1 commit
    • unknown's avatar
      Fix for bug #6266 "Invalid DATETIME value is not handled properly". · 1ef40cb2
      unknown authored
      In server we assume that datetime values stored in MYSQL_TIME struct
      are normalized (and year is not greater than 9999), so we should 
      perform range checks in all places then we convert something to
      MYSQL_TIME. 
      
      
      include/my_time.h:
        Added one more argument to set_zero_time() function to make it more 
        convinient.
        Added comment clarifying why MAX_DATE_STRING_REP_LENGTH value is 30.
      include/mysql_time.h:
        Documented MySQL's internal assumptions for members of MYSQL_TIME
        structure.
      libmysql/libmysql.c:
        It does not make sense to set MYSQL_TIME::time_type twice in case of 
        errors.
      mysql-test/r/type_datetime.result:
        Added test for bug #6266 "Invalid DATETIME value not handled properly".
      mysql-test/t/type_datetime.test:
        Added test for bug #6266 "Invalid DATETIME value not handled properly".
      sql-common/my_time.c:
        str_to_datetime(): Added missing check for too big year values.
        set_zero_time(): added time_type argument, since MYSQL_TIMESTAMP_NONE
          is not the value that we want in most cases.
      sql/field.cc:
        Field_datetime::store_time():
          clarified why we don't perform any range checks here.
      sql/item.cc:
        Item_param::set_time():
         Added comment describing this method and range checking for TIME
         values.
      sql/sql_prepare.cc:
        Removed comments about range checking for TIME values in prepared 
        statements, which are no longer true.
        set_zero_time() has one more argument now.
      tests/client_test.c:
        Added test for bug #6266 "Invalid DATETIME value not handled properly"
      1ef40cb2
  14. 12 Nov, 2004 1 commit
    • unknown's avatar
      After merge fixes · a1267042
      unknown authored
      client/mysqldump.c:
        Merge with 4.0 (and reordering of options)
      client/mysqltest.c:
        Added DB as a user variable
      myisam/mi_check.c:
        Trivial cleanup
      mysql-test/r/grant.result:
        Move test to be in same order as in 4.0
      mysql-test/r/mix_innodb_myisam_binlog.result:
        Updated results
      mysql-test/r/ps_1general.result:
        Updated tests to work after privilege fixes
      mysql-test/r/timezone3.result:
        Updated results to 4.1
      mysql-test/t/ps_1general.test:
        Updated tests to work after privilege fixes
      sql-common/my_time.c:
        Applied sub-second patch from 4.0
      sql/sql_acl.cc:
        More debugging
      a1267042
  15. 27 Oct, 2004 1 commit
    • unknown's avatar
      A fix and test case for Bug#6096 "field.max_length is always zero for · 7c040432
      unknown authored
      numeric columns (stmt_resultset_metadata)"
      
      
      libmysql/libmysql.c:
        A fix for Bug#6096 "field.max_length is always zero for numeric columns
         (stmt_resultset_metadata)": set field->max_lenght for numeric
        columns when we set up skip_result functions. A minor drawback for this 
        approach is that field->max_length  can be not zero even if 
        STMT_ATTR_UPDATE_MAX_LENGTH is not set.
      sql-common/my_time.c:
        Fix valgrind warning.
      tests/client_test.c:
        A test case for Bug#6096 "field.max_length is always zero for numeric 
        columns (stmt_resultset_metadata)
      7c040432
  16. 26 Oct, 2004 1 commit
    • unknown's avatar
      A lot of fixes for prepared statements (PS): · 8255e5a3
      unknown authored
      New mysqltest that can run mysqltest with PS
      Added support for ZEROFILL in PS
      Fixed crash when one called mysql_stmt_store_result() without a preceding mysql_stmt_bind_result()
      Updated test cases to support --ps-protocol
      (Some tests are still run using old protocol)
      Fixed crash in PS when using SELECT * FROM t1 NATURAL JOIN t2...
      Fixed crash in PS when using sub queries
      Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever"
      Fixed wrong permissions check in PS and multi-table updates (one could get permission denied for legal quries)
      Fix for PS and SELECT ... PROCEDURE
      Reset all warnings when executing a new PS query
      group_concat(...ORDER BY) didn't work with PS
      Fixed problem with test suite when not using innodb
      
      
      BitKeeper/deleted/.del-innodb-lock-master.opt~f76a4a1999728f87:
        Delete: mysql-test/t/innodb-lock-master.opt
      client/Makefile.am:
        mysqltest now uses regex
      client/mysqltest.c:
        Added support for testing of prepared statements (with --ps-protocol)
        Main code was done by Kent, I did mainly some cleanups and minor bug fixes
        New test commands:
        --disable_ps_protocol
        --enable_ps_protocol
        NOTE: new code still has some things that needs to be cleaned up.
        For example run_query_stmt_handle_error() should be made more general so that same code can be used also by 'normal' queries
      configure.in:
        mysqltest now uses regex
      libmysql/libmysql.c:
        Reset warning_count after prepare (safety). In the future we should also provide warnings on prepare
        integer -> string conversion now handles ZEROFILL
        double -> string conversion is now closer to the one in the server
        Fixed crash when one called mysql_stmt_store_result() without preceding mysql_stmt_bind_result()
      libmysqld/examples/Makefile.am:
        mysqltest now uses regex
      mysql-test/include/have_query_cache.inc:
        Fixes for --ps-protocol
      mysql-test/include/ps_conv.inc:
        Fixes for --ps-protocol
      mysql-test/mysql-test-run.sh:
        Added options --ps-protocol
      mysql-test/r/ctype_utf8.result:
        Fixed test case
      mysql-test/r/fulltext_cache.result:
        Changed output of MATCH to use round() to get same numbers with --ps-protocol
      mysql-test/r/fulltext_left_join.result:
        Changed output of MATCH to use round() to get same numbers with --ps-protocol
      mysql-test/r/fulltext_multi.result:
        Changed output of MATCH to use round() to get same numbers with --ps-protocol
      mysql-test/r/innodb-lock.result:
        Fixed test to work even if Innodb is not compiled in.
      mysql-test/t/create.test:
        Fixes for --ps-protocol
      mysql-test/t/ctype_utf8.test:
        Remove warnings
      mysql-test/t/date_formats.test:
        Fixes for --ps-protocol
      mysql-test/t/fulltext_cache.test:
        Changed output of MATCH to use round() to get same numbers with --ps-protocol
      mysql-test/t/fulltext_left_join.test:
        Changed output of MATCH to use round() to get same numbers with --ps-protocol
      mysql-test/t/fulltext_multi.test:
        Changed output of MATCH to use round() to get same numbers with --ps-protocol
      mysql-test/t/func_group.test:
        Fixes for --ps-protocol
      mysql-test/t/func_sapdb.test:
        Fixes for --ps-protocol
      mysql-test/t/innodb-lock.test:
        Fixed test to work even if Innodb is not compiled in.
      mysql-test/t/insert.test:
        Fixes for --ps-protocol
      mysql-test/t/insert_select.test:
        Fixes for --ps-protocol
      mysql-test/t/insert_update.test:
        Fixes for --ps-protocol
      mysql-test/t/metadata.test:
        Fixes for --ps-protocol
      mysql-test/t/multi_statement.test:
        Fixes for --ps-protocol
      mysql-test/t/ps_1general.test:
        Fixes for --ps-protocol
      mysql-test/t/rollback.test:
        Fixes for --ps-protocol
      mysql-test/t/rpl_redirect.test:
        Fixes for --ps-protocol
      mysql-test/t/rpl_user_variables.test:
        Fixes for --ps-protocol
      mysql-test/t/select.test:
        Fixes for --ps-protocol
      mysql-test/t/status.test:
        Fixes for --ps-protocol
      mysql-test/t/type_blob.test:
        Fixes for --ps-protocol
      mysql-test/t/type_float.test:
        Fixes for --ps-protocol
      mysql-test/t/union.test:
        Fixes for --ps-protocol
      mysql-test/t/warnings.test:
        Fixes for --ps-protocol
      mysys/my_alloc.c:
        More debugging information
      sql-common/client.c:
        More debugging information
      sql-common/my_time.c:
        TIME didn't support full range with PS
      sql/field.cc:
        TIME didn't support full range with PS
      sql/item_cmpfunc.cc:
        IN(constants,...) didn't work with PS
      sql/item_subselect.cc:
        Some subqueries didn't work with PS
      sql/item_sum.cc:
        group_concat(...ORDER BY) didn't work with PS
        Removed variable warning_available as 'warning' can be used for this.
      sql/item_sum.h:
        Removed not needed variable
      sql/protocol.cc:
        TIME didn't support full range with PS
      sql/set_var.cc:
        Style fix
      sql/sql_base.cc:
        setup_wild() didn't properly restore old arena, which caused core dump in PS when using
        SELECT * FROM t1 NATURAL JOIN t2...
      sql/sql_class.cc:
        Style fix
      sql/sql_error.cc:
        Style fix
      sql/sql_insert.cc:
        Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever"
      sql/sql_lex.h:
        Fix for PS and procedures
      sql/sql_parse.cc:
        More debugging information
        Make a copy of 'db' in PS as this may change
        Fixed wrong permissions check in PS and multi-table updates
      sql/sql_prepare.cc:
        Fix for PS and SELECT ... PROCEDURE
        Reset all warnings when executing a new query
      sql/sql_union.cc:
        Fixes for PS and SELECT ... PROCEDURE
        Reset 'with_wild' as 'wild' is resolved on prepare
      8255e5a3
  17. 15 Oct, 2004 1 commit
    • unknown's avatar
      A fix and test case for Bug#6049 "Loss of sign when using prepared · 50129a20
      unknown authored
      statements and negative time/date values". 
      The bug was in wrong sprintf format used in the client library.
      The fix moves TIME -> string conversion functions to sql-common and
      utilized them in the client library.
      
      
      include/my_time.h:
        Declarations for new functions shared between the client and server.
      libmysql/libmysql.c:
        Fix for Bug#6049 "Loss of sign when using prepared statements and negative
        time/date values": use the same function as the server to convert
        date/time/datetime values to strings.
      sql-common/my_time.c:
        Implementation of my_{time,datetime,date,TIME}_to_str: it's
        needed by the client library, so it should be shared.
      sql/field.cc:
        Don't create String object if it's not needed.
      sql/item.cc:
        Don't create String object if it's not needed: TIME_to_string was
        moved to my_TIME_to_str, with different arguments.
      sql/item_timefunc.cc:
        Don't create String object if it's not needed.
      sql/mysql_priv.h:
        TIME_to_string and MAX_DATE_REP_LENGTH moved to the client library.
        MAX_DATE_REP_LENGTH was renamed to MAX_DATE_STRING_REP_LENGTH to not 
        conflict with the same name in libmysql.c
      sql/protocol.cc:
        Don't create String object if it's not needed.
      sql/time.cc:
        Implementation of my_{time,date,datetime,TIME}_to_str moved to my_time.c
        shared between the client and the server.
      tests/client_test.c:
        A test case for Bug#6049.
      50129a20
  18. 28 Sep, 2004 1 commit
    • unknown's avatar
      Strict mode & better warnings · cf5e6660
      unknown authored
      Under strict mode MySQL will generate an error message if there was any conversion when assigning data to a field.
      Added checking of date/datetime fields.
      If strict mode, give error if we have not given value to field without a default value (for INSERT)
      
      
      client/mysqltest.c:
        Added --exit as an option to abort a test in a middle (good for debugging)
      include/my_time.h:
        Added flags to allow checking of dates in strict mode
      include/mysql_com.h:
        Added flag to check if field has a default value or not
      include/mysqld_error.h:
        New error messages for strict mode
      include/sql_state.h:
        Fixed SQL states (for strict mode tests)
      mysql-test/r/auto_increment.result:
        Updated error messages
      mysql-test/r/func_sapdb.result:
        Added test for ALLOW_INVALID_DATES
      mysql-test/r/func_str.result:
        Updated error messages
      mysql-test/r/func_time.result:
        Updated error messages
      mysql-test/r/insert.result:
        Updated error messages
      mysql-test/r/loaddata.result:
        Updated error messages
      mysql-test/r/select.result:
        Updated error messages
      mysql-test/r/sp.result:
        Updated error messages
      mysql-test/r/timezone2.result:
        Updated error messages
      mysql-test/r/type_datetime.result:
        Updated error messages
      mysql-test/r/type_decimal.result:
        Updated error messages
      mysql-test/r/type_float.result:
        Updated error messages
      mysql-test/r/type_ranges.result:
        Updated error messages
      mysql-test/r/type_time.result:
        Updated error messages
      mysql-test/r/type_uint.result:
        Updated error messages
      mysql-test/r/warnings.result:
        Updated error messages
      mysql-test/t/func_sapdb.test:
        Aded test
      sql-common/my_time.c:
        Added checking of dates
      sql/field.cc:
        Better error messages
        Optimization of warning handling (by introducing of check_int())
        Changed to use my_strtoll10()
      sql/field.h:
        Added check_int()
      sql/item_func.cc:
        Warnings when dividing by NULL
      sql/item_func.h:
        Warnings when dividing by NULL
      sql/item_timefunc.cc:
        Testing of date/datetime
        Use macros instead of constants
      sql/mysql_priv.h:
        New modes (part of strict mode)
      sql/mysqld.cc:
        New modes (part of strict mode)
      sql/opt_range.cc:
        Simple optimizations
      sql/protocol.cc:
        Add note/warning level to find_handler()
      sql/set_var.cc:
        Added mode 'traditional'
      sql/share/czech/errmsg.txt:
        New error messages for strict mode
      sql/share/danish/errmsg.txt:
        New error messages for strict mode
      sql/share/dutch/errmsg.txt:
        New error messages for strict mode
      sql/share/english/errmsg.txt:
        New error messages for strict mode
      sql/share/estonian/errmsg.txt:
        New error messages for strict mode
      sql/share/french/errmsg.txt:
        New error messages for strict mode
      sql/share/german/errmsg.txt:
        New error messages for strict mode
      sql/share/greek/errmsg.txt:
        New error messages for strict mode
      sql/share/hungarian/errmsg.txt:
        New error messages for strict mode
      sql/share/italian/errmsg.txt:
        New error messages for strict mode
      sql/share/japanese/errmsg.txt:
        New error messages for strict mode
      sql/share/korean/errmsg.txt:
        New error messages for strict mode
      sql/share/norwegian-ny/errmsg.txt:
        New error messages for strict mode
      sql/share/norwegian/errmsg.txt:
        New error messages for strict mode
      sql/share/polish/errmsg.txt:
        New error messages for strict mode
      sql/share/portuguese/errmsg.txt:
        New error messages for strict mode
      sql/share/romanian/errmsg.txt:
        New error messages for strict mode
      sql/share/russian/errmsg.txt:
        New error messages for strict mode
      sql/share/serbian/errmsg.txt:
        New error messages for strict mode
      sql/share/slovak/errmsg.txt:
        New error messages for strict mode
      sql/share/spanish/errmsg.txt:
        New error messages for strict mode
      sql/share/swedish/errmsg.txt:
        New error messages for strict mode
      sql/share/ukrainian/errmsg.txt:
        New error messages for strict mode
      sql/sp_rcontext.cc:
        Add note/warning level to find_handler()
      sql/sp_rcontext.h:
        Add note/warning level to find_handler()
      sql/sql_base.cc:
        Fix bug for detecting crashed table
      sql/sql_class.cc:
        Variables for strct mode
      sql/sql_class.h:
        Variables for strct mode
      sql/sql_error.cc:
        In strict mode, convert warnings to errors
      sql/sql_insert.cc:
        Strict mode
        If strict mode, give error if we have not given value to field without a default value
      sql/sql_load.cc:
        Strict mode
      sql/sql_parse.cc:
        Strict mode.
        Add flag to field if it doesn't have a default value
      sql/sql_select.cc:
        Added comment
        Prepare for upper level handling of table->status
      sql/sql_union.cc:
        Added THD to write_record()
      sql/sql_update.cc:
        Strict mode
      sql/table.cc:
        Handling of default values
      sql/time.cc:
        Checking of dates
      cf5e6660
  19. 02 Sep, 2004 1 commit
    • unknown's avatar
      A fix and test case for Bug#4231 "Wrong result with MYSQL_TIME · a6fe5f24
      unknown authored
      parameters": when unpacking binary time recieved from client, handle
      the case when length is 0: it means all MYSQL_TIME members are zero.
      
      
      include/my_time.h:
        Declaration for set_zero_time: a tiny piece of code, which I
        see no reason to not reuse.
      libmysql/libmysql.c:
        set_zero_time implementation is now shared between client and
        server.
      sql-common/my_time.c:
        set_zero_time implementation added.
      sql/sql_prepare.cc:
        A fix for Bug#4231 "Wrong result with MYSQL_TIME parameters": 
        when unpacking binary time recieved from client, handle the
        case when length is 0: it means all MYSQL_TIME members are zero.
      tests/client_test.c:
        Test case for bug#4231 "Wrong result with MYSQL_TIME parameters"
      a6fe5f24
  20. 24 Aug, 2004 1 commit
    • unknown's avatar
      Fixed windows-specific warning about undeclared localtime_r() in my_time.c. · 9b0d9af1
      unknown authored
      We have to include my_pthread.h since it is the place where localtime_r() is declared 
      on platforms where this function is missing.
      
      
      sql-common/my_time.c:
        We have to include my_pthread.h since it is the place where localtime_r() is declared 
        on platforms where this function is missing.
      9b0d9af1
  21. 03 Aug, 2004 1 commit
  22. 30 Jul, 2004 1 commit
  23. 29 Jul, 2004 1 commit
    • unknown's avatar
      WL#1580: --start-datetime, --stop-datetime, --start-position (alias for... · 5296a9bf
      unknown authored
      WL#1580: --start-datetime, --stop-datetime, --start-position (alias for --position) and --stop-position
      options for mysqlbinlog, with a test file.
      This enables user to say "recover my database to how it was this morning at 10:30"
      (mysqlbinlog "--stop-datetime=2003-07-29 10:30:00").
      Using time functions into client/ made me move them out of sql/ into sql-common/.
      + (small) fix for BUG#4507 "mysqlbinlog --read-from-remote-server sometimes
      cannot accept 2 binlogs" (that is, on command line).
      
      
      client/client_priv.h:
        new options for mysqlbinlog
      client/mysqlbinlog.cc:
        WL#1580: --start-datetime, --stop-datetime, --start-position (alias for --position) and --stop-position.
        (small) fix for BUG#4507 "mysqlbinlog --read-from-remote-server sometimes
         cannot accept 2 binlogs".
      include/my_time.h:
        importing time functions so that client/ files can use them.
      include/mysql_time.h:
        importing time types so that client/ files can use them.
      sql-common/my_time.c:
        importing time functions so that client/ files can use them.
      sql/mysql_priv.h:
        moving time functions out of sql/ into sql-common/
      sql/time.cc:
        moving time functions out of sql/ into sql-common/
      sql/tztime.h:
        moving time functions out of sql/ into sql-common/
      5296a9bf
  24. 24 Jun, 2004 1 commit