Commit ea01fff5 authored by Alexander Barkov's avatar Alexander Barkov

Fixing test failures caused by the previous commits.

Adding "--source include/have_udf.inc" and a few "--replace" commands.
parent 2dbd2693
......@@ -18,7 +18,7 @@ CREATE FUNCTION IF NOT EXISTS metaphon RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
SELECT ret FROM mysql.func WHERE name like 'metaphon';
ret
1
CREATE OR REPLACE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "udf_example.so";
CREATE OR REPLACE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
SELECT ret FROM mysql.func WHERE name like 'metaphon';
ret
......@@ -27,7 +27,7 @@ CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
SELECT ret FROM mysql.func WHERE name like 'metaphon';
ret
0
CREATE FUNCTION metaphon RETURNS STRING SONAME "udf_example.so";
CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
ERROR HY000: Function 'metaphon' already exists
SELECT metaphon('mariadb');
metaphon('mariadb')
......
......@@ -31,7 +31,7 @@ CREATE OR REPLACE TABLE t1(id INT);
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN END;
ERROR 42000: alter routine command denied to user 'mysqltest_1'@'localhost' for routine 'db1.proc1'
CREATE OR REPLACE FUNCTION lookup RETURNS STRING SONAME "udf_example.so";
CREATE OR REPLACE FUNCTION lookup RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql'
CREATE OR REPLACE FUNCTION hello(str char(20)) RETURNS TEXT RETURN CONCAT('Hello, ', str, '!');
ERROR 42000: alter routine command denied to user 'mysqltest_1'@'localhost' for routine 'db1.hello'
......
......@@ -4,28 +4,28 @@ CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
SELECT metaphon('master');
metaphon('master')
MSTR
CREATE FUNCTION metaphon RETURNS INT SONAME "udf_example.so";
CREATE FUNCTION metaphon RETURNS INT SONAME "UDF_EXAMPLE_LIB";
ERROR HY000: Function 'metaphon' already exists
SELECT metaphon('slave');
metaphon('slave')
SLF
CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "udf_example.so";
CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
Warnings:
Note 1125 Function 'metaphon' already exists
DROP FUNCTION IF EXISTS random_function_name;
Warnings:
Note 1305 FUNCTION test.random_function_name does not exist
CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "udf_example.so";
CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
Warnings:
Note 1125 Function 'metaphon' already exists
CREATE OR REPLACE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "udf_example.so";
CREATE OR REPLACE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
SELECT metaphon('slave');
metaphon('slave')
SLF
DROP FUNCTION metaphon;
CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME "udf_example.so";
CREATE FUNCTION metaphon RETURNS STRING SONAME "udf_example.so";
CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
ERROR HY000: Function 'metaphon' already exists
SELECT metaphon('slave');
metaphon('slave')
......
--source include/have_udf.inc
--source include/master-slave.inc
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
connection master;
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
SELECT metaphon('master');
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
--error ER_UDF_EXISTS
eval CREATE FUNCTION metaphon RETURNS INT SONAME "$UDF_EXAMPLE_SO";
......@@ -15,10 +17,13 @@ SELECT metaphon('slave');
connection master;
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
DROP FUNCTION IF EXISTS random_function_name;
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
--error ER_WRONG_USAGE
eval CREATE OR REPLACE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
sync_slave_with_master;
......@@ -28,8 +33,10 @@ SELECT metaphon('slave');
connection master;
DROP FUNCTION metaphon;
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
--error ER_UDF_EXISTS
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
sync_slave_with_master;
......
--source include/have_udf.inc
--source include/have_log_bin.inc
--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)
......
--source include/have_udf.inc
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
SELECT ret FROM mysql.func WHERE name like 'metaphon';
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
--error ER_UDF_EXISTS
CREATE FUNCTION metaphon RETURNS INT SONAME "$UDF_EXAMPLE_SO";
SELECT ret FROM mysql.func WHERE name like 'metaphon';
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
SELECT ret FROM mysql.func WHERE name like 'metaphon';
......@@ -15,6 +19,7 @@ DROP FUNCTION IF EXISTS metaphon;
eval CREATE FUNCTION IF NOT EXISTS metaphon RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
SELECT ret FROM mysql.func WHERE name like 'metaphon';
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
--error ER_WRONG_USAGE
eval CREATE OR REPLACE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
SELECT ret FROM mysql.func WHERE name like 'metaphon';
......@@ -23,6 +28,7 @@ SELECT ret FROM mysql.func WHERE name like 'metaphon';
eval CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
SELECT ret FROM mysql.func WHERE name like 'metaphon';
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
--error ER_UDF_EXISTS
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
SELECT metaphon('mariadb');
......
--source include/have_udf.inc
# Grant tests not performed with embedded server
-- source include/not_embedded.inc
......@@ -44,8 +45,9 @@ CREATE OR REPLACE TABLE t1(id INT);
--error ER_PROCACCESS_DENIED_ERROR
CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN END;
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
--error ER_DBACCESS_DENIED_ERROR
CREATE OR REPLACE FUNCTION lookup RETURNS STRING SONAME "udf_example.so";
eval CREATE OR REPLACE FUNCTION lookup RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
--error ER_PROCACCESS_DENIED_ERROR
CREATE OR REPLACE FUNCTION hello(str char(20)) RETURNS TEXT RETURN CONCAT('Hello, ', str, '!');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment