summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2014-03-07 00:21:25 +0400
committerAlexander Barkov <bar@mnogosearch.org>2014-03-07 00:21:25 +0400
commit89e171535563dcdf1eeb309e54abc4da2f5dd539 (patch)
tree79331d73d127f4226b274e86f476ba1f86c721e9 /tests
parentb95c8ce530cbbd92b232324dc2c4376615bd1b5d (diff)
downloadmariadb-git-89e171535563dcdf1eeb309e54abc4da2f5dd539.tar.gz
MDEV-5372 Make "CAST(time_expr AS DATETIME)" compatible with MySQL-5.6 (and the SQL Standard)
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index b3bbebb2433..7fd68fec308 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -5976,6 +5976,10 @@ static void test_bind_date_conv(uint row_count)
MYSQL_TIME tm[4];
ulong second_part;
uint year, month, day, hour, minute, sec;
+ uint now_year= 1990, now_month= 3, now_day= 13;
+
+ rc= mysql_query(mysql, "SET timestamp=UNIX_TIMESTAMP('1990-03-13')");
+ myquery(rc);
stmt= mysql_simple_prepare(mysql, "INSERT INTO test_date VALUES(?, ?, ?, ?)");
check_stmt(stmt);
@@ -6076,9 +6080,15 @@ static void test_bind_date_conv(uint row_count)
i, tm[i].year, tm[i].month, tm[i].day,
tm[i].hour, tm[i].minute, tm[i].second,
tm[i].second_part);
- DIE_UNLESS(tm[i].year == 0 || tm[i].year == year+count);
- DIE_UNLESS(tm[i].month == 0 || tm[i].month == month+count);
- DIE_UNLESS(tm[i].day == 0 || tm[i].day == day+count);
+ DIE_UNLESS(tm[i].year == 0 || tm[i].year == year + count ||
+ (tm[i].year == now_year &&
+ my_bind[i].buffer_type == MYSQL_TYPE_TIME));
+ DIE_UNLESS(tm[i].month == 0 || tm[i].month == month + count ||
+ (tm[i].month == now_month &&
+ my_bind[i].buffer_type == MYSQL_TYPE_TIME));
+ DIE_UNLESS(tm[i].day == 0 || tm[i].day == day + count ||
+ (tm[i].day == now_day &&
+ my_bind[i].buffer_type == MYSQL_TYPE_TIME));
DIE_UNLESS(tm[i].hour == 0 || tm[i].hour == hour+count);
DIE_UNLESS(tm[i].minute == 0 || tm[i].minute == minute+count);