summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorAshish Agarwal <ashish.y.agarwal@oracle.com>2013-05-19 23:38:06 +0530
committerAshish Agarwal <ashish.y.agarwal@oracle.com>2013-05-19 23:38:06 +0530
commit918b6a3e7a5f669e345af7d614c09a4c1543375b (patch)
tree24753afbd8c14c24de460f691e8e4a67e50a32c8 /mysql-test/r
parent00cf6212e5a6d9837151d6e5cd1cfef2edc82254 (diff)
downloadmariadb-git-918b6a3e7a5f669e345af7d614c09a4c1543375b.tar.gz
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.
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/plugin.result82
1 files changed, 81 insertions, 1 deletions
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
index 0d5bc29fc8c..2b96dc4f3ac 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -16,9 +16,11 @@ set global example_ulong_var=500;
set global example_enum_var= e1;
show status like 'example%';
Variable_name Value
-example_func_example enum_var is 0, ulong_var is 500, really
+example_func_example enum_var is 0, ulong_var is 500, double_var is 8.500000, really
show variables like 'example%';
Variable_name Value
+example_double_thdvar 8.500000
+example_double_var 8.500000
example_enum_var e1
example_ulong_var 500
UNINSTALL PLUGIN example;
@@ -63,3 +65,81 @@ set session sql_mode=@old_sql_mode;
set session old=bla;
ERROR HY000: Variable 'old' is a read only variable
UNINSTALL PLUGIN example;
+#
+# Bug #16194302 SUPPORT FOR FLOATING-POINT SYSTEM
+# VARIABLES USING THE PLUGIN INTERFACE.
+#
+INSTALL PLUGIN example SONAME 'ha_example.so';
+SET GLOBAL example_double_var = -0.1;
+Warnings:
+Warning 1292 Truncated incorrect example_double_var value: '-0.1'
+SELECT @@GLOBAL.example_double_var;
+@@GLOBAL.example_double_var
+0.500000
+SET GLOBAL example_double_var = 0.000001;
+Warnings:
+Warning 1292 Truncated incorrect example_double_var value: '0.000001'
+SELECT @@GLOBAL.example_double_var;
+@@GLOBAL.example_double_var
+0.500000
+SET GLOBAL example_double_var = 0.4;
+Warnings:
+Warning 1292 Truncated incorrect example_double_var value: '0.4'
+SELECT @@GLOBAL.example_double_var;
+@@GLOBAL.example_double_var
+0.500000
+SET GLOBAL example_double_var = 123.456789;
+SELECT @@GLOBAL.example_double_var;
+@@GLOBAL.example_double_var
+123.456789
+SET GLOBAL example_double_var = 500;
+SELECT @@GLOBAL.example_double_var;
+@@GLOBAL.example_double_var
+500.000000
+SET GLOBAL example_double_var = 999.999999;
+SELECT @@GLOBAL.example_double_var;
+@@GLOBAL.example_double_var
+999.999999
+SET GLOBAL example_double_var = 1000.51;
+Warnings:
+Warning 1292 Truncated incorrect example_double_var value: '1000.51'
+SELECT @@GLOBAL.example_double_var;
+@@GLOBAL.example_double_var
+1000.500000
+SET SESSION example_double_thdvar = -0.1;
+Warnings:
+Warning 1292 Truncated incorrect example_double_thdvar value: '-0.1'
+SELECT @@SESSION.example_double_thdvar;
+@@SESSION.example_double_thdvar
+0.500000
+SET SESSION example_double_thdvar = 0.000001;
+Warnings:
+Warning 1292 Truncated incorrect example_double_thdvar value: '0.000001'
+SELECT @@SESSION.example_double_thdvar;
+@@SESSION.example_double_thdvar
+0.500000
+SET SESSION example_double_thdvar = 0.4;
+Warnings:
+Warning 1292 Truncated incorrect example_double_thdvar value: '0.4'
+SELECT @@SESSION.example_double_thdvar;
+@@SESSION.example_double_thdvar
+0.500000
+SET SESSION example_double_thdvar = 123.456789;
+SELECT @@SESSION.example_double_thdvar;
+@@SESSION.example_double_thdvar
+123.456789
+SET SESSION example_double_thdvar = 500;
+SELECT @@SESSION.example_double_thdvar;
+@@SESSION.example_double_thdvar
+500.000000
+SET SESSION example_double_thdvar = 999.999999;
+SELECT @@SESSION.example_double_thdvar;
+@@SESSION.example_double_thdvar
+999.999999
+SET SESSION example_double_thdvar = 1000.51;
+Warnings:
+Warning 1292 Truncated incorrect example_double_thdvar value: '1000.51'
+SELECT @@SESSION.example_double_thdvar;
+@@SESSION.example_double_thdvar
+1000.500000
+UNINSTALL PLUGIN example;