aboutsummaryrefslogtreecommitdiff
path: root/qt/mysql/date-time/test.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-07-03 11:59:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-07-03 11:59:08 +0200
commitd31e96535e3f41c36646f375680d7a4efc5772b2 (patch)
tree23fc92c12ae707cd255e4d885808e824a4c25520 /qt/mysql/date-time/test.hxx
parent6cd8b9f561b912f264ba4f723845935c40a3cb95 (diff)
Test MySQL sub-second precision support
Diffstat (limited to 'qt/mysql/date-time/test.hxx')
-rw-r--r--qt/mysql/date-time/test.hxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/qt/mysql/date-time/test.hxx b/qt/mysql/date-time/test.hxx
index 7e58376..2570285 100644
--- a/qt/mysql/date-time/test.hxx
+++ b/qt/mysql/date-time/test.hxx
@@ -51,4 +51,21 @@ struct object
QTime time;
};
+// 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