Bug #114931 start transaction read only not work
Submitted: 9 May 2024 7:17 Modified: 9 May 2024 10:42
Reporter: Bing Ma (OCA) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:8.0.30 OS:Linux
Assigned to: CPU Architecture:Any

[9 May 2024 7:17] Bing Ma
Description:
start transaction read only; statement not work, still can create database

How to repeat:
docker exec -it 1740f3ab47b5 bash
bash-4.4# mysql -uroot -proot123!
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.30 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> start transaction read only;
Query OK, 0 rows affected (0.00 sec)

mysql> create databaes a2134;
ERROR 1064 (42000): 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 'databaes a2134' at line 1
mysql> create database a2134;
Query OK, 1 row affected (0.01 sec)

mysql> commit;
Query OK, 0 rows affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| a2134              |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.00 sec)

mysql>
[9 May 2024 10:42] MySQL Verification Team
Hi Mr. Ma,

Thank you for your bug report.

However, we can not repeat it with 8.0.37:

Database
a2134
information_schema
mysql
performance_schema
sys
test

We even tried this:

use a2134;
ERROR 1049 (42000): Unknown database 'a2134'

Can't repeat.