Welcome to the OceanBase. Commands end with ; or \g.
Your OceanBase connection id is 48
Server version: OceanBase_CE 4.1.0.0 (r100000192023032010-0265dfc6d00ff4f0ff4ad2710504a18962abaef6) (Built Mar 20 2023 10:12:57)
Copyright (c) 2000, 2018, OB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
obclient [oceanbase]> use test;
Database changed
obclient [test]> create table aa(a int primary key,b varchar(20));
Query OK, 0 rows affected (0.163 sec)
obclient [test]> create table bb(id int primary key, a_fk int, c varchar(20), FOREIGN KEY (a_fk) REFERENCES aa (a));
Query OK, 0 rows affected (0.174 sec)
obclient [test]> insert into aa values(1,"aa"),(2,"bb"),(3,"cc");
Query OK, 3 rows affected (0.036 sec)
Records: 3 Duplicates: 0 Warnings: 0
obclient [test]> insert into bb values(1,1,"aaaa"),(2,2,"bbbb"),(3,3,"ccc");
Query OK, 3 rows affected (0.026 sec)
Records: 3 Duplicates: 0 Warnings: 0
obclient [test]> drop table aa;
ERROR 3730 (HY000): Cannot drop table 'aa' referenced by a foreign key constraint 'bb_OBFK_1680786970843957' on table 'bb'
obclient [test]> select version();
+------------------------------+
| version() |
+------------------------------+
| 5.7.25-OceanBase_CE-v4.1.0.0 |
+------------------------------+
1 row in set (0.002 sec)