Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO: R&D self-test DDL #125

Open
andyli029 opened this issue Sep 15, 2022 · 6 comments
Open

TODO: R&D self-test DDL #125

andyli029 opened this issue Sep 15, 2022 · 6 comments
Assignees
Labels
Developer Test Developer Test prio: high High priority
Milestone

Comments

@andyli029
Copy link
Owner

andyli029 commented Sep 15, 2022

From #108

@andyli029 andyli029 added this to the Basic Run milestone Sep 15, 2022
@andyli029 andyli029 added Developer Test Developer Test prio: high High priority labels Sep 15, 2022
@lujiashun
Copy link
Contributor

lujiashun commented Sep 16, 2022

DDL

failed:× ; pass:✓

1. DATABASE

1.1. CREATE DATABASE [✓]

mysql> create database lujs1;
Query OK, 1 row affected (0.01 sec)

1.2. SHOW DATABASE [✓]

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| lujs               |
| mysql              |
| performance_schema |
| sys                |
| test               |
+--------------------+
6 rows in set (0.01 sec)

1.3. DROP DATABASE [✓?]

mysql> drop database lujs1;
Query OK, 0 rows affected (0.09 sec)

note: in some abnormal senario as below, TODO:

mysql> drop database lujs;
ERROR 1010 (HY000): Error dropping database (can't rmdir './lujs/', errno: 17 - File exists)

2. TABLE

2.1. CREATE TABLE [✓]

mysql> CREATE TABLE `t_test` (
    ->   `id` int(11) NOT NULL AUTO_INCREMENT,
    ->   `first_name` varchar(10),
    ->   `last_name` varchar(10),
    ->   `sex` varchar(5),
    ->   `score` int(11),
    ->   `copy_id` int(11),
    ->   PRIMARY KEY (`id`)
    -> ) ENGINE=TIANMU DEFAULT CHARSET=utf8;
Query OK, 0 rows affected, 4 warnings (0.06 sec)

2.2. CTAS [✓]

mysql> insert into t_test(first_name) values("zhao"),("qian"),("sun");
Query OK, 3 rows affected (0.03 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> select * from t_test;
+----+------------+-----------+------+-------+---------+
| id | first_name | last_name | sex  | score | copy_id |
+----+------------+-----------+------+-------+---------+
|  1 | zhao       | NULL      | NULL |  NULL |    NULL |
|  2 | qian       | NULL      | NULL |  NULL |    NULL |
|  3 | sun        | NULL      | NULL |  NULL |    NULL |
+----+------------+-----------+------+-------+---------+
3 rows in set (0.00 sec)

mysql> Create table t_test1 AS SELECT * from t_test;
Query OK, 3 rows affected (0.06 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> select * from t_test1;
+----+------------+-----------+------+-------+---------+
| id | first_name | last_name | sex  | score | copy_id |
+----+------------+-----------+------+-------+---------+
|  1 | zhao       | NULL      | NULL |  NULL |    NULL |
|  2 | qian       | NULL      | NULL |  NULL |    NULL |
|  3 | sun        | NULL      | NULL |  NULL |    NULL |
+----+------------+-----------+------+-------+---------+
3 rows in set (0.01 sec)

2.3. ALTER TABLE [ ]

#125 (comment)

2.4. TRUNCATE TABLE [✓]

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| lineitem_i342  |
+----------------+
1 row in set (0.01 sec)

mysql> truncate table lineitem_i342;
Query OK, 0 rows affected (0.01 sec)

2.5. SHOW TABLES [✓]

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| account        |
| lineitem_i342  |
+----------------+
2 rows in set (0.01 sec)

2.6. SHOW CREATE TABLE [✓]

mysql> show create table account;

+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table   | Create Table                                                                                                                                           |
+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| account | CREATE TABLE `account` (
  `acct_num` int DEFAULT NULL,
  `amount` int DEFAULT NULL
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci |
+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

2.7. DROP TABLE [✓]

mysql> drop table account;
Query OK, 0 rows affected (0.02 sec)

2.8. 重组表 [ ]

2.9. CREATE TABLE LIKE [✓ ]

mysql> create table lujs3 like lineitem_i342;
Query OK, 0 rows affected (0.08 sec)

3. VIEW

#125 (comment)

3.1. CREATE VIEW [✓]

3.2. SHOW CREATE VIEW [✓]

3.3. ALTER VIEW [✓]

3.4. DROP VIEW [✓]

4. TRIGGER

#125 (comment)

4.1. CREATE TRIGGER [✓]

4.2. SHOW CREATE TRIGGER [✓]

4.3. SHOW TRIGGERS [✓]

4.4. DROP TRIGGER [✓]

5. PROCEDURE

#125 (comment)

5.1. CREATE PROCEDURE [✓]

5.2. ALTER PROCEDURE [✓]

5.3. DROP PROCEDURE [✓]

5.4. SHOW CREATE PROCEDURE[✓]

6. FUNCTION

6.1. CREATE FUNCTION [✓]

6.2. ALTER FUNCTION [✓]

6.3. DROP FUNCTION [✓]

6.5. SHOW CREATE FUNCTION [✓]

@lujiashun
Copy link
Contributor

lujiashun commented Sep 16, 2022

alter table

alter table t_test add column ex_column int [✓]

mysql> alter table t_test add column ex_column int;
Query OK, 0 rows affected (0.14 sec)
Records: 0  Duplicates: 0  Warnings: 0

alter table t_test drop column ex_column [✓]

mysql> alter table t_test drop column ex_column;
Query OK, 0 rows affected (0.06 sec)
Records: 0  Duplicates: 0  Warnings: 0

alter table t_test rename t_test1 [✓]

mysql> alter table t_test rename t_test2;
Query OK, 0 rows affected (0.01 sec)

alter table t_test modify [×]

alter table t_test modify first_name varchar(5); [TBD]
alter table t_test modify first_name char(20); [TBD]
alter table t_test modify first_name char(5); [TBD]
alter table t_test modify sex smallint(5); [TBD]
alter table t_test modify sex char(5); [TBD]
need merge from 5.7 to 8.0

@lujiashun
Copy link
Contributor

lujiashun commented Sep 16, 2022

view

mysql> CREATE TABLE `lineitem_i342` (
    -> `l_orderkey` int(11) NOT NULL,
    -> `l_partkey` int(11) NOT NULL,
    -> `l_suppkey` int(11) NOT NULL,
    -> `l_linenumber` int(11) NOT NULL,
    -> `l_quantity` decimal(15,2) NOT NULL,
    -> `l_extendedprice` decimal(15,2) NOT NULL,
    -> `l_discount` decimal(15,2) NOT NULL,
    -> `l_tax` decimal(15,2) NOT NULL,
    -> `l_returnflag` char(1) NOT NULL,
    -> `l_linestatus` char(1) NOT NULL,
    -> `l_shipdate` date NOT NULL,
    -> `l_commitdate` date NOT NULL,
    -> `l_receiptdate` date NOT NULL,
    -> `l_shipinstruct` char(25) NOT NULL,
    -> `l_shipmode` char(10) NOT NULL,
    -> `l_comment` varchar(44) NOT NULL,
    -> PRIMARY KEY (`l_orderkey`,`l_linenumber`)
    -> ) ENGINE=TIANMU;
Query OK, 0 rows affected, 4 warnings (0.06 sec)

mysql> INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment) VALUES(842980, 1881559, 56614, 4, 5.00, 7702.30, 0.01, 0.03, 'A', 'F', '1992-01-02', '1992-03-20', '1992-01-20', 'COLLECT COD', 'REG AIR', 'lly regular asymptotes. unu');
, 0.10, 0.08, 'A', 'F', '1992-01-02', '1992-02-18', '1992-01-23', 'COLLECT COD', 'FOB', 'encies haggle. regular, r');
INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_Query OK, 1 row affected (0.02 sec)

mysql> INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment) VALUES(1111877, 1341765, 16805, 3, 20.00, 36134.00, 0.10, 0.07, 'A', 'F', '1992-01-02', '1992-02-28', '1992-01-07', 'TAKE BACK RETURN', 'FOB', 're. ideas wake');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment) VALUES(1332613, 539811, 14827, 1, 14.00, 25911.06, 0.08, 0.07, 'A', 'F', '1992-01-02', '1992-02-11', '1992-01-18', 'TAKE BACK RETURN', 'TRUCK', 'y against the furiously regular');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment) VALUES(2184032, 1394196, 44223, 5, 14.00, 18061.82, 0.06, 0.02, 'A', 'F', '1992-01-02', '1992-02-25', '1992-01-15', 'DELIVER IN PERSON', 'RAIL', 'even ideas breach slyly above the d');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment) VALUES(5018977, 820387, 20388, 1, 20.00, 26146.80, 0.00, 0.00, 'A', 'F', '1992-01-02', '1992-03-19', '1992-01-15', 'NONE', 'SHIP', 'packages detect furiously quick');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment) VALUES(8478693, 842913, 92930, 5, 13.00, 24126.31, 0.01, 0.03, 'A', 'F', '1992-01-02', '1992-02-02', '1992-01-05', 'DELIVER IN PERSON', 'REG AIR', 'y silent decoys');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment) VALUES(9838337, 201251, 26254, 1, 10.00, 11522.40, 0.03, 0.05, 'A', 'F', '1992-01-02', '1992-03-27', '1992-01-22', 'NONE', 'RAIL', 'pending pinto beans. boldly unusual de');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment) VALUES(11174723, 851066, 76075, 1, 41.00, 41697.82, 0.07, 0.02, 'A', 'F', '1992-01-02', '1992-03-28', '1992-01-08', 'NONE', 'MAIL', 's detect blithely entic');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment) VALUES(12493984, 912626, 87654, 4, 6.00, 9831.48, 0.02, 0.08, 'A', 'F', '1992-01-02', '1992-02-13', '1992-01-29', 'TAKE BACK RETURN', 'REG AIR', 'e the slyly e');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment) VALUES(12575687, 330833, 30834, 4, 41.00, 76416.62, 0.02, 0.04, 'A', 'F', '1992-01-02', '1992-03-10', '1992-01-28', 'DELIVER IN PERSON', 'RAIL', 'ecial frets. carefully sly depo');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment) VALUES(12753441, 1023833, 98864, 4, 35.00, 61487.30, 0.10, 0.08, 'A', 'F', '1992-01-02', '1992-02-18', '1992-01-23', 'COLLECT COD', 'FOB', 'encies haggle. regular, r');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO lineitem_i342 (l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity, l_extendedprice, l_discount, l_tax, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment) VALUES(15413986, 1799270, 99271, 4, 14.00, 19168.66, 0.05, 0.05, 'A', 'F', '1992-01-02', '1992-01-31', '1992-01-04', 'COLLECT COD', 'TRUCK', 'structions. blithely pending asymptotes');
Query OK, 1 row affected (0.00 sec)

mysql> CREATE VIEW revenue_i342 AS SELECT l_suppkey AS supplier_no, sum(l_extendedprice * (1 - l_discount)) AS total_revenue FROM lineitem_i342 WHERE l_shipdate >= '1992-01-01' AND l_shipdate < DATE_ADD('1992-01-01',INTERVAL 3 MONTH) GROUP BY l_suppkey;
Query OK, 0 rows affected (0.01 sec)

mysql> SELECT * FROM revenue_i342 ORDER BY supplier_no;
+-------------+---------------+
| supplier_no | total_revenue |
+-------------+---------------+
|       14827 |    23838.1752 |
|       16805 |    32520.6000 |
|       20388 |    26146.8000 |
|       26254 |    11176.7280 |
|       30834 |    74888.2876 |
|       44223 |    16978.1108 |
|       56614 |     7625.2770 |
|       76075 |    38778.9726 |
|       87654 |     9634.8504 |
|       92930 |    23885.0469 |
|       98864 |    55338.5700 |
|       99271 |    18210.2270 |
+-------------+---------------+
12 rows in set (0.00 sec)
mysql> show create view revenue_i342;
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
| View         | Create View                                                                                                                                                                                                                                                                                                                                                                                                                                    | character_set_client | collation_connection |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
| revenue_i342 | CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `revenue_i342` AS select `lineitem_i342`.`l_suppkey` AS `supplier_no`,sum((`lineitem_i342`.`l_extendedprice` * (1 - `lineitem_i342`.`l_discount`))) AS `total_revenue` from `lineitem_i342` where ((`lineitem_i342`.`l_shipdate` >= '1992-01-01') and (`lineitem_i342`.`l_shipdate` < ('1992-01-01' + interval 3 month))) group by `lineitem_i342`.`l_suppkey` | utf8mb4              | utf8mb4_general_ci   |
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
1 row in set (0.00 sec)

mysql> alter VIEW revenue_i342 AS SELECT l_suppkey AS supplier_no, sum(l_extendedprice * (2 - l_discount)) AS total_revenue FROM lineitem_i342 WHERE l_shipdate>= '1992-01-01' AND l_shipdate < DATE_ADD('1992-01-01',INTERVAL 3 MONTH) GROUP BY l_suppkey;
Query OK, 0 rows affected (0.02 sec)

mysql> DROP VIEW revenue_i342;
Query OK, 0 rows affected (0.02 sec)

@lujiashun
Copy link
Contributor

lujiashun commented Sep 16, 2022

TRIGGER

CREATE TRIGGER

mysql> CREATE TABLE account (acct_num INT, amount INT) ENGINE=TIANMU;
Query OK, 0 rows affected (0.03 sec)

mysql> CREATE TRIGGER ins_sum BEFORE INSERT ON account FOR EACH ROW SET @sum = @ sum + NEW.amount;
Query OK, 0 rows affected (0.02 sec)

mysql> SET @sum = 0;
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO account VALUES(137,14),(141,1937),(97,100);
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0

mysql> SELECT @sum AS 'Total amount inserted';
+-----------------------+
| Total amount inserted |
+-----------------------+
| 2051 |
+-----------------------+
1 row in set (0.00 sec)

SHOW CREATE TRIGGER

mysql> show create trigger ins_sum;
+---------+--------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+------------------------+
| Trigger | sql_mode | SQL Original Statement | character_set_client | collation_connection | Database Collation | Created |
+---------+--------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+------------------------+
| ins_sum | STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION | CREATE DEFINER=root@localhost TRIGGER ins_sum BEFORE INSERT ON account FOR EACH ROW SET @sum = @sum + NEW.amount | utf8mb4 | utf8mb4_general_ci | utf8mb4_general_ci | 2022-09-16 06:17:37.60 |
+---------+--------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+------------------------+
1 row in set (0.01 sec)

SHOW TRIGGERS

mysql> show triggers;
+---------+--------+---------+------------------------------+--------+------------------------+--------------------------------------------+----------------+----------------------+----------------------+--------------------+
| Trigger | Event | Table | Statement | Timing | Created | sql_mode | Definer | character_set_client | collation_connection | Database Collation |
+---------+--------+---------+------------------------------+--------+------------------------+--------------------------------------------+----------------+----------------------+----------------------+--------------------+
| ins_sum | INSERT | account | SET @sum = @sum + NEW.amount | BEFORE | 2022-09-16 06:17:37.60 | STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION | root@localhost | utf8mb4 | utf8mb4_general_ci | utf8mb4_general_ci |
+---------+--------+---------+------------------------------+--------+------------------------+--------------------------------------------+----------------+----------------------+----------------------+--------------------+
1 row in set (0.02 sec)

DROP TRIGGER

mysql> drop trigger ins_sum;
Query OK, 0 rows affected (0.01 sec)

@lujiashun
Copy link
Contributor

lujiashun commented Sep 16, 2022

PROCEDURE

mysql> delimiter //
mysql> CREATE  PROCEDURE mycount (IN country INT, OUT supplies INT)
    -> BEGIN
    -> SELECT COUNT(*) INTO supplies FROM test.lineitem_i342
    -> WHERE l_suppkey = country;
    -> END//
Query OK, 0 rows affected (0.01 sec)

mysql> delimiter ;
mysql> CALL mycount(14827, @supplies);
Query OK, 1 row affected (0.01 sec)

mysql> SELECT @supplies;
+-----------+
| @supplies |
+-----------+
|         1 |
+-----------+
1 row in set (0.00 sec)

mysql> SHOW CREATE PROCEDURE mycount;
+-----------+--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
| Procedure | sql_mode                                   | Create Procedure                                                                                                                                                                   | character_set_client | collation_connection | Database Collation |
+-----------+--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
| mycount   | STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION | CREATE DEFINER=`root`@`localhost` PROCEDURE `mycount`(IN country INT, OUT supplies INT)
BEGIN
SELECT COUNT(*) INTO supplies FROM test.lineitem_i342
WHERE l_suppkey = country;
END | utf8mb4              | utf8mb4_general_ci   | utf8mb4_general_ci |
+-----------+--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+--------------------+
1 row in set (0.00 sec)

mysql> alter procedure mycount comment "test";
Query OK, 0 rows affected (0.01 sec)

@lujiashun
Copy link
Contributor

lujiashun commented Sep 16, 2022

FUNCTION

mysql> CREATE FUNCTION hello (s CHAR(20))
    -> RETURNS CHAR(50) DETERMINISTIC
    -> RETURN CONCAT('Hello, ',s,'!');
Query OK, 0 rows affected (0.01 sec)

mysql> SELECT hello('world');
+----------------+
| hello('world') |
+----------------+
| Hello, world!  |
+----------------+
1 row in set (0.00 sec)

mysql> SHOW CREATE FUNCTION hello;
+----------+--------------------------------------------+--------------------------------------------------------                                                                       -----------------------------------------------------------------------------------------------------------------                                                                       ----+----------------------+----------------------+--------------------+
| Function | sql_mode                                   | Create Function                                                                                                                                                                                                                                                                                                           | character_set_client | collation_connection | Database Collation |
+----------+--------------------------------------------+--------------------------------------------------------                                                                       -----------------------------------------------------------------------------------------------------------------                                                                       ----+----------------------+----------------------+--------------------+
| hello    | STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION | CREATE DEFINER=`root`@`localhost` FUNCTION `hello`(s CH                                                                       AR(20)) RETURNS char(50) CHARSET utf8mb4 COLLATE utf8mb4_general_ci
    DETERMINISTIC
RETURN CONCAT('Hello, ',s,'!') | utf8mb4              | utf8mb4_general_ci   | utf8mb4_general_ci |
+----------+--------------------------------------------+--------------------------------------------------------                                                                       -----------------------------------------------------------------------------------------------------------------                                                                       ----+----------------------+----------------------+--------------------+
1 row in set (0.00 sec)

mysql> ALTER FUNCTION  hello comment "hi";
Query OK, 0 rows affected (0.01 sec)

mysql> drop function hello;
Query OK, 0 rows affected (0.01 sec)

mysql>

@lujiashun lujiashun self-assigned this Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Test Developer Test prio: high High priority
Projects
None yet
Development

No branches or pull requests

2 participants