Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
VC++Files/libmysql/libmysql.dsp:
new file: my_time.c
VC++Files/libmysqld/libmysqld.dsp:
new file: my_time.c
VC++Files/sql/mysqld.dsp:
new file: my_time.c
include/Makefile.am:
- mysql_time.h added to the list of installed client library headers
include/mysql.h:
- declarations for MYSQL_TIME and enum_mysql_timestamp_type moved to
mysql_time.h, which is in shared use of client library and mysys.
libmysql/Makefile.shared:
- my_time.lo added to the list of libmysql objects
libmysql/libmysql.c:
Fix for bug#4030 "Client side conversion string -> date type doesn't work
(prepared statements)" and cleanup.
- added case labels for TIME/DATE/DATETIME types to send_data_str
- comments for read_binary_{date,time,datetime}, fetch_result_*, fetch_results.
libmysqld/Makefile.am:
- my_time.c added
sql-common/Makefile.am:
- my_time.c added to the list of files included into source distribution.
sql/Makefile.am:
my_time.c added to the list of mysqld sources.
sql/field.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item_timefunc.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/mysql_priv.h:
- added typedefs for TIME and timestamp_type
- removed declarations for str_to_time and str_to_TIME (now this functions
reside in mysys)
sql/mysqld.cc:
- log_10_int moved to mysys (it's used by str_to_TIME and str_to_time)
- enum values TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
sql/set_var.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/set_var.h:
- fixed timestamp_type usage to be compatible with typedef.
sql/sql_prepare.cc:
- TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
- embedded library implementation of set_param_{time,date,datetime} is
much simplier now, as MYSQL_TIME is the same as TIME.
sql/sql_yacc.yy:
- s/\<TIMESTAMP_/MYSQL_TIMESTAMP/gc
sql/structs.h:
- declarations for TIME and timestamp_type replaced with typedefs
- str_to_datetime arguments moved to mysys headers
sql/time.cc:
- str_to_time and str_to_TIME moved to mysys
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} as these names are now
exported to client.
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- str_to_TIME_with_warn renamed accordingly
sql/tztime.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
tests/client_test.c:
- a test case for Bug#4030 "Client side conversion string -> date type
doesn't work (prepared statements)"
2004-06-24 17:08:36 +02:00
|
|
|
/* Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
|
|
|
|
/*
|
|
|
|
This is a private header of sql-common library, containing
|
|
|
|
declarations for my_time.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _my_time_h_
|
|
|
|
#define _my_time_h_
|
|
|
|
#include "my_global.h"
|
|
|
|
#include "mysql_time.h"
|
|
|
|
|
|
|
|
C_MODE_START
|
|
|
|
|
|
|
|
extern ulonglong log_10_int[20];
|
2004-08-19 22:40:31 +02:00
|
|
|
extern uchar days_in_month[];
|
Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
VC++Files/libmysql/libmysql.dsp:
new file: my_time.c
VC++Files/libmysqld/libmysqld.dsp:
new file: my_time.c
VC++Files/sql/mysqld.dsp:
new file: my_time.c
include/Makefile.am:
- mysql_time.h added to the list of installed client library headers
include/mysql.h:
- declarations for MYSQL_TIME and enum_mysql_timestamp_type moved to
mysql_time.h, which is in shared use of client library and mysys.
libmysql/Makefile.shared:
- my_time.lo added to the list of libmysql objects
libmysql/libmysql.c:
Fix for bug#4030 "Client side conversion string -> date type doesn't work
(prepared statements)" and cleanup.
- added case labels for TIME/DATE/DATETIME types to send_data_str
- comments for read_binary_{date,time,datetime}, fetch_result_*, fetch_results.
libmysqld/Makefile.am:
- my_time.c added
sql-common/Makefile.am:
- my_time.c added to the list of files included into source distribution.
sql/Makefile.am:
my_time.c added to the list of mysqld sources.
sql/field.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item_timefunc.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/mysql_priv.h:
- added typedefs for TIME and timestamp_type
- removed declarations for str_to_time and str_to_TIME (now this functions
reside in mysys)
sql/mysqld.cc:
- log_10_int moved to mysys (it's used by str_to_TIME and str_to_time)
- enum values TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
sql/set_var.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/set_var.h:
- fixed timestamp_type usage to be compatible with typedef.
sql/sql_prepare.cc:
- TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
- embedded library implementation of set_param_{time,date,datetime} is
much simplier now, as MYSQL_TIME is the same as TIME.
sql/sql_yacc.yy:
- s/\<TIMESTAMP_/MYSQL_TIMESTAMP/gc
sql/structs.h:
- declarations for TIME and timestamp_type replaced with typedefs
- str_to_datetime arguments moved to mysys headers
sql/time.cc:
- str_to_time and str_to_TIME moved to mysys
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} as these names are now
exported to client.
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- str_to_TIME_with_warn renamed accordingly
sql/tztime.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
tests/client_test.c:
- a test case for Bug#4030 "Client side conversion string -> date type
doesn't work (prepared statements)"
2004-06-24 17:08:36 +02:00
|
|
|
|
2004-08-05 23:16:43 +02:00
|
|
|
/*
|
|
|
|
Portable time_t replacement.
|
|
|
|
Should be signed and hold seconds for 1902-2038 range.
|
|
|
|
*/
|
|
|
|
typedef long my_time_t;
|
|
|
|
|
|
|
|
#define MY_TIME_T_MAX LONG_MAX
|
|
|
|
#define MY_TIME_T_MIN LONG_MIN
|
|
|
|
|
Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
VC++Files/libmysql/libmysql.dsp:
new file: my_time.c
VC++Files/libmysqld/libmysqld.dsp:
new file: my_time.c
VC++Files/sql/mysqld.dsp:
new file: my_time.c
include/Makefile.am:
- mysql_time.h added to the list of installed client library headers
include/mysql.h:
- declarations for MYSQL_TIME and enum_mysql_timestamp_type moved to
mysql_time.h, which is in shared use of client library and mysys.
libmysql/Makefile.shared:
- my_time.lo added to the list of libmysql objects
libmysql/libmysql.c:
Fix for bug#4030 "Client side conversion string -> date type doesn't work
(prepared statements)" and cleanup.
- added case labels for TIME/DATE/DATETIME types to send_data_str
- comments for read_binary_{date,time,datetime}, fetch_result_*, fetch_results.
libmysqld/Makefile.am:
- my_time.c added
sql-common/Makefile.am:
- my_time.c added to the list of files included into source distribution.
sql/Makefile.am:
my_time.c added to the list of mysqld sources.
sql/field.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item_timefunc.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/mysql_priv.h:
- added typedefs for TIME and timestamp_type
- removed declarations for str_to_time and str_to_TIME (now this functions
reside in mysys)
sql/mysqld.cc:
- log_10_int moved to mysys (it's used by str_to_TIME and str_to_time)
- enum values TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
sql/set_var.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/set_var.h:
- fixed timestamp_type usage to be compatible with typedef.
sql/sql_prepare.cc:
- TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
- embedded library implementation of set_param_{time,date,datetime} is
much simplier now, as MYSQL_TIME is the same as TIME.
sql/sql_yacc.yy:
- s/\<TIMESTAMP_/MYSQL_TIMESTAMP/gc
sql/structs.h:
- declarations for TIME and timestamp_type replaced with typedefs
- str_to_datetime arguments moved to mysys headers
sql/time.cc:
- str_to_time and str_to_TIME moved to mysys
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} as these names are now
exported to client.
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- str_to_TIME_with_warn renamed accordingly
sql/tztime.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
tests/client_test.c:
- a test case for Bug#4030 "Client side conversion string -> date type
doesn't work (prepared statements)"
2004-06-24 17:08:36 +02:00
|
|
|
#define YY_PART_YEAR 70
|
|
|
|
|
|
|
|
/* Flags to str_to_datetime */
|
2004-09-28 19:08:00 +02:00
|
|
|
#define TIME_FUZZY_DATE 1
|
|
|
|
#define TIME_DATETIME_ONLY 2
|
|
|
|
/* Must be same as MODE_NO_ZERO_IN_DATE */
|
|
|
|
#define TIME_NO_ZERO_IN_DATE (65536L*2*2*2*2*2*2*2)
|
|
|
|
/* Must be same as MODE_NO_ZERO_DATE */
|
|
|
|
#define TIME_NO_ZERO_DATE (TIME_NO_ZERO_IN_DATE*2)
|
|
|
|
#define TIME_INVALID_DATES (TIME_NO_ZERO_DATE*2)
|
Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
VC++Files/libmysql/libmysql.dsp:
new file: my_time.c
VC++Files/libmysqld/libmysqld.dsp:
new file: my_time.c
VC++Files/sql/mysqld.dsp:
new file: my_time.c
include/Makefile.am:
- mysql_time.h added to the list of installed client library headers
include/mysql.h:
- declarations for MYSQL_TIME and enum_mysql_timestamp_type moved to
mysql_time.h, which is in shared use of client library and mysys.
libmysql/Makefile.shared:
- my_time.lo added to the list of libmysql objects
libmysql/libmysql.c:
Fix for bug#4030 "Client side conversion string -> date type doesn't work
(prepared statements)" and cleanup.
- added case labels for TIME/DATE/DATETIME types to send_data_str
- comments for read_binary_{date,time,datetime}, fetch_result_*, fetch_results.
libmysqld/Makefile.am:
- my_time.c added
sql-common/Makefile.am:
- my_time.c added to the list of files included into source distribution.
sql/Makefile.am:
my_time.c added to the list of mysqld sources.
sql/field.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item_timefunc.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/mysql_priv.h:
- added typedefs for TIME and timestamp_type
- removed declarations for str_to_time and str_to_TIME (now this functions
reside in mysys)
sql/mysqld.cc:
- log_10_int moved to mysys (it's used by str_to_TIME and str_to_time)
- enum values TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
sql/set_var.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/set_var.h:
- fixed timestamp_type usage to be compatible with typedef.
sql/sql_prepare.cc:
- TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
- embedded library implementation of set_param_{time,date,datetime} is
much simplier now, as MYSQL_TIME is the same as TIME.
sql/sql_yacc.yy:
- s/\<TIMESTAMP_/MYSQL_TIMESTAMP/gc
sql/structs.h:
- declarations for TIME and timestamp_type replaced with typedefs
- str_to_datetime arguments moved to mysys headers
sql/time.cc:
- str_to_time and str_to_TIME moved to mysys
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} as these names are now
exported to client.
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- str_to_TIME_with_warn renamed accordingly
sql/tztime.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
tests/client_test.c:
- a test case for Bug#4030 "Client side conversion string -> date type
doesn't work (prepared statements)"
2004-06-24 17:08:36 +02:00
|
|
|
|
|
|
|
enum enum_mysql_timestamp_type
|
|
|
|
str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
|
|
|
|
uint flags, int *was_cut);
|
2004-12-16 01:15:06 +01:00
|
|
|
longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res,
|
2005-07-19 01:12:44 +02:00
|
|
|
uint flags, int *was_cut);
|
2004-12-16 01:15:06 +01:00
|
|
|
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);
|
|
|
|
|
Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
VC++Files/libmysql/libmysql.dsp:
new file: my_time.c
VC++Files/libmysqld/libmysqld.dsp:
new file: my_time.c
VC++Files/sql/mysqld.dsp:
new file: my_time.c
include/Makefile.am:
- mysql_time.h added to the list of installed client library headers
include/mysql.h:
- declarations for MYSQL_TIME and enum_mysql_timestamp_type moved to
mysql_time.h, which is in shared use of client library and mysys.
libmysql/Makefile.shared:
- my_time.lo added to the list of libmysql objects
libmysql/libmysql.c:
Fix for bug#4030 "Client side conversion string -> date type doesn't work
(prepared statements)" and cleanup.
- added case labels for TIME/DATE/DATETIME types to send_data_str
- comments for read_binary_{date,time,datetime}, fetch_result_*, fetch_results.
libmysqld/Makefile.am:
- my_time.c added
sql-common/Makefile.am:
- my_time.c added to the list of files included into source distribution.
sql/Makefile.am:
my_time.c added to the list of mysqld sources.
sql/field.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item_timefunc.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/mysql_priv.h:
- added typedefs for TIME and timestamp_type
- removed declarations for str_to_time and str_to_TIME (now this functions
reside in mysys)
sql/mysqld.cc:
- log_10_int moved to mysys (it's used by str_to_TIME and str_to_time)
- enum values TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
sql/set_var.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/set_var.h:
- fixed timestamp_type usage to be compatible with typedef.
sql/sql_prepare.cc:
- TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
- embedded library implementation of set_param_{time,date,datetime} is
much simplier now, as MYSQL_TIME is the same as TIME.
sql/sql_yacc.yy:
- s/\<TIMESTAMP_/MYSQL_TIMESTAMP/gc
sql/structs.h:
- declarations for TIME and timestamp_type replaced with typedefs
- str_to_datetime arguments moved to mysys headers
sql/time.cc:
- str_to_time and str_to_TIME moved to mysys
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} as these names are now
exported to client.
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- str_to_TIME_with_warn renamed accordingly
sql/tztime.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
tests/client_test.c:
- a test case for Bug#4030 "Client side conversion string -> date type
doesn't work (prepared statements)"
2004-06-24 17:08:36 +02:00
|
|
|
|
2005-07-31 11:49:55 +02:00
|
|
|
my_bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time,
|
|
|
|
int *was_cut);
|
Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
VC++Files/libmysql/libmysql.dsp:
new file: my_time.c
VC++Files/libmysqld/libmysqld.dsp:
new file: my_time.c
VC++Files/sql/mysqld.dsp:
new file: my_time.c
include/Makefile.am:
- mysql_time.h added to the list of installed client library headers
include/mysql.h:
- declarations for MYSQL_TIME and enum_mysql_timestamp_type moved to
mysql_time.h, which is in shared use of client library and mysys.
libmysql/Makefile.shared:
- my_time.lo added to the list of libmysql objects
libmysql/libmysql.c:
Fix for bug#4030 "Client side conversion string -> date type doesn't work
(prepared statements)" and cleanup.
- added case labels for TIME/DATE/DATETIME types to send_data_str
- comments for read_binary_{date,time,datetime}, fetch_result_*, fetch_results.
libmysqld/Makefile.am:
- my_time.c added
sql-common/Makefile.am:
- my_time.c added to the list of files included into source distribution.
sql/Makefile.am:
my_time.c added to the list of mysqld sources.
sql/field.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item_timefunc.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/mysql_priv.h:
- added typedefs for TIME and timestamp_type
- removed declarations for str_to_time and str_to_TIME (now this functions
reside in mysys)
sql/mysqld.cc:
- log_10_int moved to mysys (it's used by str_to_TIME and str_to_time)
- enum values TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
sql/set_var.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/set_var.h:
- fixed timestamp_type usage to be compatible with typedef.
sql/sql_prepare.cc:
- TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
- embedded library implementation of set_param_{time,date,datetime} is
much simplier now, as MYSQL_TIME is the same as TIME.
sql/sql_yacc.yy:
- s/\<TIMESTAMP_/MYSQL_TIMESTAMP/gc
sql/structs.h:
- declarations for TIME and timestamp_type replaced with typedefs
- str_to_datetime arguments moved to mysys headers
sql/time.cc:
- str_to_time and str_to_TIME moved to mysys
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} as these names are now
exported to client.
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- str_to_TIME_with_warn renamed accordingly
sql/tztime.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
tests/client_test.c:
- a test case for Bug#4030 "Client side conversion string -> date type
doesn't work (prepared statements)"
2004-06-24 17:08:36 +02:00
|
|
|
|
2004-07-29 23:25:58 +02:00
|
|
|
long calc_daynr(uint year,uint month,uint day);
|
2004-09-28 19:08:00 +02:00
|
|
|
uint calc_days_in_year(uint year);
|
2004-07-29 23:25:58 +02:00
|
|
|
|
|
|
|
void init_time(void);
|
|
|
|
|
|
|
|
my_time_t
|
2005-07-31 11:49:55 +02:00
|
|
|
my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone,
|
|
|
|
my_bool *in_dst_time_gap);
|
2004-07-29 23:25:58 +02:00
|
|
|
|
2004-11-15 13:44:29 +01:00
|
|
|
void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type);
|
2004-09-02 18:16:01 +02:00
|
|
|
|
2004-10-15 22:12:59 +02:00
|
|
|
/*
|
|
|
|
Required buffer length for my_time_to_str, my_date_to_str,
|
|
|
|
my_datetime_to_str and TIME_to_string functions. Note, that the
|
|
|
|
caller is still responsible to check that given TIME structure
|
|
|
|
has values in valid ranges, otherwise size of the buffer could
|
2004-11-15 13:44:29 +01:00
|
|
|
be not enough. We also rely on the fact that even wrong values
|
|
|
|
sent using binary protocol fit in this buffer.
|
2004-10-15 22:12:59 +02:00
|
|
|
*/
|
|
|
|
#define MAX_DATE_STRING_REP_LENGTH 30
|
|
|
|
|
|
|
|
int my_time_to_str(const MYSQL_TIME *l_time, char *to);
|
|
|
|
int my_date_to_str(const MYSQL_TIME *l_time, char *to);
|
|
|
|
int my_datetime_to_str(const MYSQL_TIME *l_time, char *to);
|
|
|
|
int my_TIME_to_str(const MYSQL_TIME *l_time, char *to);
|
|
|
|
|
2006-01-18 20:41:22 +01:00
|
|
|
/*
|
|
|
|
The following must be sorted so that simple intervals comes first.
|
|
|
|
(get_interval_value() depends on this)
|
|
|
|
*/
|
|
|
|
|
|
|
|
enum interval_type
|
|
|
|
{
|
|
|
|
INTERVAL_YEAR, INTERVAL_QUARTER, INTERVAL_MONTH, INTERVAL_DAY, INTERVAL_HOUR,
|
|
|
|
INTERVAL_MINUTE, INTERVAL_WEEK, INTERVAL_SECOND, INTERVAL_MICROSECOND ,
|
|
|
|
INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR, INTERVAL_DAY_MINUTE,
|
|
|
|
INTERVAL_DAY_SECOND, INTERVAL_HOUR_MINUTE, INTERVAL_HOUR_SECOND,
|
|
|
|
INTERVAL_MINUTE_SECOND, INTERVAL_DAY_MICROSECOND, INTERVAL_HOUR_MICROSECOND,
|
|
|
|
INTERVAL_MINUTE_MICROSECOND, INTERVAL_SECOND_MICROSECOND
|
|
|
|
};
|
|
|
|
|
Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
VC++Files/libmysql/libmysql.dsp:
new file: my_time.c
VC++Files/libmysqld/libmysqld.dsp:
new file: my_time.c
VC++Files/sql/mysqld.dsp:
new file: my_time.c
include/Makefile.am:
- mysql_time.h added to the list of installed client library headers
include/mysql.h:
- declarations for MYSQL_TIME and enum_mysql_timestamp_type moved to
mysql_time.h, which is in shared use of client library and mysys.
libmysql/Makefile.shared:
- my_time.lo added to the list of libmysql objects
libmysql/libmysql.c:
Fix for bug#4030 "Client side conversion string -> date type doesn't work
(prepared statements)" and cleanup.
- added case labels for TIME/DATE/DATETIME types to send_data_str
- comments for read_binary_{date,time,datetime}, fetch_result_*, fetch_results.
libmysqld/Makefile.am:
- my_time.c added
sql-common/Makefile.am:
- my_time.c added to the list of files included into source distribution.
sql/Makefile.am:
my_time.c added to the list of mysqld sources.
sql/field.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/item_timefunc.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/mysql_priv.h:
- added typedefs for TIME and timestamp_type
- removed declarations for str_to_time and str_to_TIME (now this functions
reside in mysys)
sql/mysqld.cc:
- log_10_int moved to mysys (it's used by str_to_TIME and str_to_time)
- enum values TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
sql/set_var.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
sql/set_var.h:
- fixed timestamp_type usage to be compatible with typedef.
sql/sql_prepare.cc:
- TIMESTAMP_{TIME,DATE,DATETIME} were renamed to
MYSQL_TIMESTAMP_{TIME,DATE,DATETIME}
- embedded library implementation of set_param_{time,date,datetime} is
much simplier now, as MYSQL_TIME is the same as TIME.
sql/sql_yacc.yy:
- s/\<TIMESTAMP_/MYSQL_TIMESTAMP/gc
sql/structs.h:
- declarations for TIME and timestamp_type replaced with typedefs
- str_to_datetime arguments moved to mysys headers
sql/time.cc:
- str_to_time and str_to_TIME moved to mysys
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...} as these names are now
exported to client.
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- str_to_TIME_with_warn renamed accordingly
sql/tztime.cc:
- TIMESTAMP_{TIME,DATE,DATETIME,...} renamed to
MYSQL_TIMESTAMP_{TIME,DATETIME,DATE,...}
tests/client_test.c:
- a test case for Bug#4030 "Client side conversion string -> date type
doesn't work (prepared statements)"
2004-06-24 17:08:36 +02:00
|
|
|
C_MODE_END
|
|
|
|
|
|
|
|
#endif /* _my_time_h_ */
|