diff options
author | unknown <konstantin@mysql.com> | 2004-12-16 03:15:06 +0300 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2004-12-16 03:15:06 +0300 |
commit | 7845f99abf1d36e972970c0fc9431956a8f4b63a (patch) | |
tree | 056f73f48d150d91c8d24bee3a927dec746492bb /include/my_time.h | |
parent | 79bf1ca8d919a0d4f91b0fa0382de3d43dd06d0f (diff) | |
download | mariadb-git-7845f99abf1d36e972970c0fc9431956a8f4b63a.tar.gz |
Data truncation reporting implementation (libmysql) + post review
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).
Diffstat (limited to 'include/my_time.h')
-rw-r--r-- | include/my_time.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/my_time.h b/include/my_time.h index 1635c55fdc9..8058df8fe4e 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -52,6 +52,13 @@ typedef long my_time_t; enum enum_mysql_timestamp_type str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, uint flags, int *was_cut); +longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, + my_bool fuzzy_date, int *was_cut); +ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *time); +ulonglong TIME_to_ulonglong_date(const MYSQL_TIME *time); +ulonglong TIME_to_ulonglong_time(const MYSQL_TIME *time); +ulonglong TIME_to_ulonglong(const MYSQL_TIME *time); + bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time, int *was_cut); |