diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-07-03 11:59:08 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-07-03 11:59:08 +0200 |
commit | d31e96535e3f41c36646f375680d7a4efc5772b2 (patch) | |
tree | 23fc92c12ae707cd255e4d885808e824a4c25520 /mysql/types/test.hxx | |
parent | 6cd8b9f561b912f264ba4f723845935c40a3cb95 (diff) |
Test MySQL sub-second precision support
Diffstat (limited to 'mysql/types/test.hxx')
-rw-r--r-- | mysql/types/test.hxx | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/mysql/types/test.hxx b/mysql/types/test.hxx index 73160c2..c46175d 100644 --- a/mysql/types/test.hxx +++ b/mysql/types/test.hxx @@ -27,14 +27,16 @@ struct date_time unsigned int d, unsigned int h, unsigned int min, - unsigned int sec) + unsigned int sec, + unsigned int msec = 0) : negative (n), year (y), month (m), day (d), hour (h), minute (min), - second (sec) + second (sec), + microseconds (msec) { } @@ -48,7 +50,8 @@ struct date_time day == y.day && hour == y.hour && minute == y.minute && - second == y.second; + second == y.second && + microseconds == y.microseconds; } bool negative; @@ -58,6 +61,7 @@ struct date_time unsigned int hour; unsigned int minute; unsigned int second; + unsigned int microseconds; }; struct bitfield @@ -305,4 +309,21 @@ struct char_array } }; +// MySQL server version view. +// +#pragma db view query( \ + "SELECT " \ + "CAST(SUBSTRING_INDEX(@@version, '.', 1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '.', 2), '.', -1) AS UNSIGNED)," \ + "CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@@version, '-', 1), '.', -1) AS UNSIGNED)," \ + "@@protocol_version") +struct mysql_version +{ + unsigned int major; + unsigned int minor; + unsigned int release; + + unsigned int protocol; +}; + #endif // TEST_HXX |