Bug #107051 Upgrade failed from 5.7.35 to 8.0.25
Submitted: 19 Apr 2022 8:32 Modified: 19 May 2022 11:57
Reporter: George Ma Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.7.35 OS:Any
Assigned to: CPU Architecture:Any

[19 Apr 2022 8:32] George Ma
Description:
Upgrade failed from 5.7.35 to 8.0.28 if exists event scheduler.

How to repeat:
1. Init with 5.7.35

2. start mysqld with 5.7.35

3. create event and shutdown:
```
create database mytest;

use mytest;

create table mytable (id int key, mycol int);

insert into mytable values (1,1);

CREATE EVENT myevent
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
DO
UPDATE mytest.mytable SET mycol = mycol + 1;

set global innodb_fast_shutdown = 0;

shutdown;
```

4. upgrade to 8.0.25
[19 Apr 2022 11:57] MySQL Verification Team
Hello George Ma,

Thank you for the report and feedback.
I quickly tried upgrading from 5.7.37 to 8.0.28 but not seeing any issues. Is there anything else I'm missing here? Please let me know.

-
- 5.7.37
rm -rf 107051/
bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/107051 --log-error-verbosity=3
bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/107051 --core-file --socket=/tmp/mysql.sock --port=3306 --log-error=$PWD/107051/log.err --log-error-verbosity=3 --secure-file-priv=""  --performance-schema=ON 2>&1 &

 bin/mysql -uroot -S /tmp/mysql.sock --local-infile
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.37-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

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> show processlist;
+----+------+-----------+------+---------+------+----------+------------------+
| Id | User | Host      | db   | Command | Time | State    | Info             |
+----+------+-----------+------+---------+------+----------+------------------+
|  2 | root | localhost | NULL | Query   |    0 | starting | show processlist |
+----+------+-----------+------+---------+------+----------+------------------+
1 row in set (0.00 sec)

mysql> set global event_scheduler=ON;
Query OK, 0 rows affected (0.00 sec)

mysql> show processlist;
+----+-----------------+-----------+------+---------+------+------------------------+------------------+
| Id | User            | Host      | db   | Command | Time | State                  | Info             |
+----+-----------------+-----------+------+---------+------+------------------------+------------------+
|  2 | root            | localhost | NULL | Query   |    0 | starting               | show processlist |
|  3 | event_scheduler | localhost | NULL | Daemon  |    8 | Waiting on empty queue | NULL             |
+----+-----------------+-----------+------+---------+------+------------------------+------------------+
2 rows in set (0.00 sec)

mysql> create database mytest;
Query OK, 1 row affected (0.00 sec)

mysql>
mysql> use mytest;
Database changed
mysql>
mysql> create table mytable (id int key, mycol int);
Query OK, 0 rows affected (0.01 sec)

mysql>
mysql> insert into mytable values (1,1);
Query OK, 1 row affected (0.00 sec)

mysql> CREATE EVENT myevent
    -> ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
    -> DO
    -> UPDATE mytest.mytable SET mycol = mycol + 1;
Query OK, 0 rows affected (0.00 sec)

mysql> set global innodb_fast_shutdown = 0;
Query OK, 0 rows affected (0.00 sec)

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

mysql> \q
Bye

- in-place upgrade

bin/mysqld --basedir=$PWD --datadir=/export/home/tmp/ushastry/mysql-advanced-5.7.37/107051 --core-file --socket=/tmp/mysql.sock  --port=3306 --log-error=/export/home/tmp/ushastry/mysql-advanced-5.7.37/107051/log.err --mysqlx-port=33330 --mysqlx-socket=/tmp/mysql_x_ushastry.sock --log-error-verbosity=3  --secure-file-priv="" --local-infile=1 2>&1 &

 bin/mysql -uroot -S /tmp/mysql.sock --local-infile
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.28-commercial MySQL Enterprise Server - Commercial

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> use mytest;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show events;
+--------+---------+----------------+-----------+----------+---------------------+----------------+----------------+--------+------+---------+------------+----------------------+----------------------+--------------------+
| Db     | Name    | Definer        | Time zone | Type     | Execute at          | Interval value | Interval field | Starts | Ends | Status  | Originator | character_set_client | collation_connection | Database Collation |
+--------+---------+----------------+-----------+----------+---------------------+----------------+----------------+--------+------+---------+------------+----------------------+----------------------+--------------------+
| mytest | myevent | root@localhost | SYSTEM    | ONE TIME | 2022-04-19 14:51:39 | NULL           | NULL           | NULL   | NULL | ENABLED |          0 | utf8                 | utf8_general_ci      | latin1_swedish_ci  |
+--------+---------+----------------+-----------+----------+---------------------+----------------+----------------+--------+------+---------+------------+----------------------+----------------------+--------------------+
1 row in set (0.00 sec)

mysql>

regards,
Umesh
[29 Apr 2022 9:24] MySQL Verification Team
Are you seeing the same issue as in Bug #107160? Please confirm. Thank you!
[20 May 2022 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".