summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2012-12-16 16:49:19 -0800
committerIgor Babaev <igor@askmonty.org>2012-12-16 16:49:19 -0800
commit7760efad74140680b1eefaf2172b0fa26f7b1146 (patch)
tree57742baa180206a1cd3ea35d38c58108accd22a9 /sql-common
parent40bbf697aad7d923fc1bd995bc5f547e45461cbe (diff)
parentb8b875cb796743240bed71857eae73d37f03c28f (diff)
downloadmariadb-git-7760efad74140680b1eefaf2172b0fa26f7b1146.tar.gz
Merge mariadb-5.5 -> 10.0-base.
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/mysql_async.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sql-common/mysql_async.c b/sql-common/mysql_async.c
index c130eab5061..c7e720076ea 100644
--- a/sql-common/mysql_async.c
+++ b/sql-common/mysql_async.c
@@ -247,6 +247,28 @@ mysql_get_timeout_value(const MYSQL *mysql)
/*
+ In 10.0, VIO timeouts are in milliseconds, so we support getting the
+ millisecond timeout value from async applications.
+
+ In 5.5, timeouts are always in seconds, but we support the 10.0 version
+ that provides milliseconds, so applications can work with either version
+ of the library easily.
+
+ When merging this to 10.0, this function must be removed and the 10.0
+ version used.
+*/
+unsigned int STDCALL
+mysql_get_timeout_value_ms(const MYSQL *mysql)
+{
+ unsigned int timeout= mysql->options.extension->async_context->timeout_value;
+ if (timeout <= UINT_MAX / 1000)
+ return timeout*1000;
+ else
+ return UINT_MAX;
+}
+
+
+/*
Now create non-blocking definitions for all the calls that may block.
Each call FOO gives rise to FOO_start() that prepares the MYSQL object for