1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-19275 Provide SQL service to plugins.

SQL service added.
It provides the limited set of client library functions
to be used by plugin.
This commit is contained in:
Alexey Botchkov
2021-09-06 22:34:35 +04:00
committed by Oleksandr Byelkin
parent 401ff6994d
commit 0a0dfd63d9
25 changed files with 701 additions and 253 deletions

View File

@@ -27,7 +27,7 @@ PLUGIN_STATUS ACTIVE
PLUGIN_TYPE AUTHENTICATION
PLUGIN_TYPE_VERSION 2.2
PLUGIN_LIBRARY auth_ed25519.so
PLUGIN_LIBRARY_VERSION 1.14
PLUGIN_LIBRARY_VERSION 1.15
PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Elliptic curve ED25519 based authentication
PLUGIN_LICENSE GPL

View File

@@ -6,7 +6,7 @@ PLUGIN_STATUS ACTIVE
PLUGIN_TYPE PASSWORD VALIDATION
PLUGIN_TYPE_VERSION 1.0
PLUGIN_LIBRARY cracklib_password_check.so
PLUGIN_LIBRARY_VERSION 1.14
PLUGIN_LIBRARY_VERSION 1.15
PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Password validation via CrackLib
PLUGIN_LICENSE GPL

View File

@@ -4,8 +4,8 @@ Variable_name Value
Opened_plugin_libraries 0
select * from information_schema.all_plugins where plugin_library='ha_example.so';
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE LOAD_OPTION PLUGIN_MATURITY PLUGIN_AUTH_VERSION
EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE MYSQL_VERSION_ID ha_example.so 1.14 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1
UNUSABLE 3.14 NOT INSTALLED DAEMON MYSQL_VERSION_ID ha_example.so 1.14 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926
EXAMPLE 0.1 NOT INSTALLED STORAGE ENGINE MYSQL_VERSION_ID ha_example.so 1.15 Brian Aker, MySQL AB Example storage engine GPL OFF Experimental 0.1
UNUSABLE 3.14 NOT INSTALLED DAEMON MYSQL_VERSION_ID ha_example.so 1.15 Sergei Golubchik Unusable Daemon GPL OFF Experimental 3.14.15.926
show status like '%libraries%';
Variable_name Value
Opened_plugin_libraries 1

View File

@@ -6,7 +6,7 @@ PLUGIN_STATUS ACTIVE
PLUGIN_TYPE PASSWORD VALIDATION
PLUGIN_TYPE_VERSION 1.0
PLUGIN_LIBRARY simple_password_check.so
PLUGIN_LIBRARY_VERSION 1.14
PLUGIN_LIBRARY_VERSION 1.15
PLUGIN_AUTHOR Sergei Golubchik
PLUGIN_DESCRIPTION Simple password strength checks
PLUGIN_LICENSE GPL

View File

@@ -1,8 +1,51 @@
install plugin test_sql_service soname 'test_sql_service';
set global test_sql_service_run_test= 1;
show status like 'test_sql_service%';
show status like 'test_sql_service_passed';
Variable_name Value
Test_sql_service_passed 0
Test_sql_service_passed 1
set global test_sql_service_run_test= 1;
show status like 'test_sql_service_passed';
Variable_name Value
Test_sql_service_passed 1
set global test_sql_service_execute_sql_local= 'create table test.t1(id int)';
show status like 'test_sql_query_result';
Variable_name Value
Test_sql_query_result Query affected 0 rows.
set global test_sql_service_execute_sql_local= 'insert into test.t1 values (1), (2)';
show status like 'test_sql_query_result';
Variable_name Value
Test_sql_query_result Query affected 2 rows.
set global test_sql_service_execute_sql_local= 'select * from test.t1';
show status like 'test_sql_query_result';
Variable_name Value
Test_sql_query_result Query returned 2 rows.
set global test_sql_service_execute_sql_local= 'drop table test.t1';
show status like 'test_sql_query_result';
Variable_name Value
Test_sql_query_result Query affected 0 rows.
set global test_sql_service_execute_sql_local= 'drop table test.t1';
show status like 'test_sql_query_result';
Variable_name Value
Test_sql_query_result Error 1051 returned. Unknown table 'test.t1'
set global test_sql_service_execute_sql_global= 'create table test.t1(id int)';
show status like 'test_sql_query_result';
Variable_name Value
Test_sql_query_result Query affected 0 rows.
set global test_sql_service_execute_sql_global= 'insert into test.t1 values (1), (2)';
show status like 'test_sql_query_result';
Variable_name Value
Test_sql_query_result Query affected 2 rows.
set global test_sql_service_execute_sql_global= 'select * from test.t1';
show status like 'test_sql_query_result';
Variable_name Value
Test_sql_query_result Query returned 2 rows.
set global test_sql_service_execute_sql_global= 'drop table test.t1';
show status like 'test_sql_query_result';
Variable_name Value
Test_sql_query_result Query affected 0 rows.
set global test_sql_service_execute_sql_global= 'drop table test.t1';
show status like 'test_sql_query_result';
Variable_name Value
Test_sql_query_result Error 1051 returned. Unknown table 'test.t1'
uninstall plugin test_sql_service;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown

View File

@@ -9,9 +9,40 @@ let count_sessions= 1;
source include/wait_until_count_sessions.inc;
install plugin test_sql_service soname 'test_sql_service';
show status like 'test_sql_service_passed';
set global test_sql_service_run_test= 1;
show status like 'test_sql_service%';
show status like 'test_sql_service_passed';
set global test_sql_service_execute_sql_local= 'create table test.t1(id int)';
show status like 'test_sql_query_result';
set global test_sql_service_execute_sql_local= 'insert into test.t1 values (1), (2)';
show status like 'test_sql_query_result';
set global test_sql_service_execute_sql_local= 'select * from test.t1';
show status like 'test_sql_query_result';
set global test_sql_service_execute_sql_local= 'drop table test.t1';
show status like 'test_sql_query_result';
set global test_sql_service_execute_sql_local= 'drop table test.t1';
show status like 'test_sql_query_result';
set global test_sql_service_execute_sql_global= 'create table test.t1(id int)';
show status like 'test_sql_query_result';
set global test_sql_service_execute_sql_global= 'insert into test.t1 values (1), (2)';
show status like 'test_sql_query_result';
set global test_sql_service_execute_sql_global= 'select * from test.t1';
show status like 'test_sql_query_result';
set global test_sql_service_execute_sql_global= 'drop table test.t1';
show status like 'test_sql_query_result';
set global test_sql_service_execute_sql_global= 'drop table test.t1';
show status like 'test_sql_query_result';
uninstall plugin test_sql_service;