File: rpl_create_drop_function.result

package info (click to toggle)
mariadb 1%3A11.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 765,428 kB
  • sloc: ansic: 2,382,827; cpp: 1,803,532; asm: 378,315; perl: 63,176; sh: 46,496; pascal: 40,776; java: 39,363; yacc: 20,428; python: 19,506; sql: 17,864; xml: 12,463; ruby: 8,544; makefile: 6,059; cs: 5,855; ada: 1,700; lex: 1,193; javascript: 1,039; objc: 80; tcl: 73; awk: 46; php: 22
file content (58 lines) | stat: -rw-r--r-- 2,005 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
include/master-slave.inc
[connection master]
connection master;
CREATE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
CONCAT('Hello, ', str, '!');
CREATE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
CONCAT('Hello, ', str, '!');
ERROR 42000: FUNCTION hello already exists
connection slave;
SHOW CREATE FUNCTION hello;
Function	sql_mode	Create Function	character_set_client	collation_connection	Database Collation
hello	STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION	CREATE DEFINER=`root`@`localhost` FUNCTION `hello`(str CHAR(20)) RETURNS char(50) CHARSET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
    DETERMINISTIC
RETURN
CONCAT('Hello, ', str, '!')	latin1	latin1_swedish_ci	utf8mb4_uca1400_ai_ci
connection master;
CREATE OR REPLACE FUNCTION IF NOT EXISTS hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
CONCAT('Hello, ', str, '!');
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
CREATE OR REPLACE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
CONCAT('Hello, ', str, '!');
SELECT hello('master');
hello('master')
Hello, master!
connection slave;
SELECT hello('slave');
hello('slave')
Hello, slave!
connection master;
CREATE FUNCTION IF NOT EXISTS hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
CONCAT('Hello, ', str, '!');
Warnings:
Note	1304	FUNCTION hello already exists
CREATE OR REPLACE FUNCTION bye (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
CONCAT('Bye, ', str, '!');
SELECT hello('master');
hello('master')
Hello, master!
SELECT bye('master');
bye('master')
Bye, master!
connection slave;
SELECT hello('slave');
hello('slave')
Hello, slave!
SELECT bye('slave');
bye('slave')
Bye, slave!
connection master;
DROP FUNCTION hello;
DROP FUNCTION IF EXISTS bye;
connection slave;
DROP FUNCTION hello;
ERROR 42000: FUNCTION test.hello does not exist
DROP FUNCTION IF EXISTS bye;
Warnings:
Note	1305	FUNCTION test.bye does not exist
include/rpl_end.inc