By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
version() |
---|
8.0.13 |
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`new_domain`,'http://',-1))' at line 1
new_domain | no_https | rev_domain |
---|---|---|
http://a.b.c | a.b.c | c.b.a |
http://d.e.f | d.e.f | f.e.d |
Table | Create Table |
---|---|
new_random | CREATE TABLE `new_random` ( `new_domain` varchar(500) NOT NULL, `no_https` varchar(500) GENERATED ALWAYS AS (substring_index(`new_domain`,_utf8mb4'http://',-(1))) VIRTUAL, `rev_domain` varchar(500) GENERATED ALWAYS AS (reverse(`no_https`)) VIRTUAL, PRIMARY KEY (`new_domain`), KEY `no_https` (`no_https`), KEY `rev_domain` (`rev_domain`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | SIMPLE | new_random | null | range | rev_domain | rev_domain | 2003 | null | 1 | 100.00 | Using where; Using index |