summaryrefslogtreecommitdiff
path: root/include/mysql_time.h
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2004-06-24 19:08:36 +0400
committerunknown <konstantin@mysql.com>2004-06-24 19:08:36 +0400
commit9dde418895f2d236234b975c4ada88ad624e8ba4 (patch)
tree51efbaacdacd9dad5c2745e3ccb58a3614f4f608 /include/mysql_time.h
parent85e9258b05b2490e35aa60adecf48a3f65245eb0 (diff)
downloadmariadb-git-9dde418895f2d236234b975c4ada88ad624e8ba4.tar.gz
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)"
Diffstat (limited to 'include/mysql_time.h')
-rw-r--r--include/mysql_time.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/mysql_time.h b/include/mysql_time.h
new file mode 100644
index 00000000000..943d018fc14
--- /dev/null
+++ b/include/mysql_time.h
@@ -0,0 +1,37 @@
+/* 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 */
+
+#ifndef _mysql_time_h_
+#define _mysql_time_h_
+
+/* Time declarations shared between server and client library */
+
+enum enum_mysql_timestamp_type
+{
+ MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
+ MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
+};
+
+
+typedef struct st_mysql_time
+{
+ unsigned int year, month, day, hour, minute, second;
+ unsigned long second_part;
+ my_bool neg;
+ enum enum_mysql_timestamp_type time_type;
+} MYSQL_TIME;
+
+#endif /* _mysql_time_h_ */