From 0c4f4ff015f7c4a06b9d4c9e8f22f44a57e2a318 Mon Sep 17 00:00:00 2001 From: Ashish Agarwal Date: Sun, 19 May 2013 23:38:06 +0530 Subject: Bug#16194302: SUPPORT FOR FLOATING-POINT SYSTEM VARIABLES USING THE PLUGIN INTERFACE. ISSUE: No support for floating-point plugin system variables. SOLUTION: Allowing plugins to define and expose floating-point system variables of type double. MYSQL_SYSVAR_DOUBLE and MYSQL_THDVAR_DOUBLE are added. ISSUE: Fractional part of the def, min, max values of system variables are ignored. SOLUTION: Adding functions that are used to store the raw representation of a double in the raw bits of unsigned longlong in a way that the binary representation remains the same. --- mysql-test/t/plugin.test | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'mysql-test/t/plugin.test') diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test index 117eaf1e19b..f3a3b0cc068 100644 --- a/mysql-test/t/plugin.test +++ b/mysql-test/t/plugin.test @@ -85,3 +85,55 @@ set session sql_mode=@old_sql_mode; set session old=bla; UNINSTALL PLUGIN example; + +--echo # +--echo # Bug #16194302 SUPPORT FOR FLOATING-POINT SYSTEM +--echo # VARIABLES USING THE PLUGIN INTERFACE. +--echo # + +--replace_regex /\.dll/.so/ +eval INSTALL PLUGIN example SONAME '$EXAMPLE_PLUGIN'; + +SET GLOBAL example_double_var = -0.1; +SELECT @@GLOBAL.example_double_var; + +SET GLOBAL example_double_var = 0.000001; +SELECT @@GLOBAL.example_double_var; + +SET GLOBAL example_double_var = 0.4; +SELECT @@GLOBAL.example_double_var; + +SET GLOBAL example_double_var = 123.456789; +SELECT @@GLOBAL.example_double_var; + +SET GLOBAL example_double_var = 500; +SELECT @@GLOBAL.example_double_var; + +SET GLOBAL example_double_var = 999.999999; +SELECT @@GLOBAL.example_double_var; + +SET GLOBAL example_double_var = 1000.51; +SELECT @@GLOBAL.example_double_var; + +SET SESSION example_double_thdvar = -0.1; +SELECT @@SESSION.example_double_thdvar; + +SET SESSION example_double_thdvar = 0.000001; +SELECT @@SESSION.example_double_thdvar; + +SET SESSION example_double_thdvar = 0.4; +SELECT @@SESSION.example_double_thdvar; + +SET SESSION example_double_thdvar = 123.456789; +SELECT @@SESSION.example_double_thdvar; + +SET SESSION example_double_thdvar = 500; +SELECT @@SESSION.example_double_thdvar; + +SET SESSION example_double_thdvar = 999.999999; +SELECT @@SESSION.example_double_thdvar; + +SET SESSION example_double_thdvar = 1000.51; +SELECT @@SESSION.example_double_thdvar; + +UNINSTALL PLUGIN example; -- cgit v1.2.1