Bug 1929713 - rubygem-mysql2 fails on mariadb 10.5, but does not on 10.4
Summary: rubygem-mysql2 fails on mariadb 10.5, but does not on 10.4
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: mariadb
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Schorm
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-17 13:37 UTC by Jun Aruga
Modified: 2021-08-10 15:25 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-08-10 15:25:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jun Aruga 2021-02-17 13:37:21 UTC
1. Please describe the problem:

The mariadb/mysql ruby binding mysql2 (rubygem-mysql2 RPM) has the 3 test failures on mariadb 10.5. The tests pass on mariadb 10.4. See https://github.com/brianmario/mysql2/issues/1152#issuecomment-777649486 for detail.


```
Failures:
  1) Mysql2::Error encoding returns error messages as UTF-8 by default
     Failure/Error: expect(bad_err.message).to include("??}\u001F")
       expected "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '??}\\001F' at line 1" to include "??}\u001F"
     # ./spec/mysql2/error_spec.rb:59:in `block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:17:in `with_internal_encoding'
     # ./spec/mysql2/error_spec.rb:52:in `block (3 levels) in <top (required)>'
  2) Mysql2::Statement should create a statement
     Failure/Error: expect { statement = @client.prepare 'SELECT 1' }.to change(&method(:stmt_count)).by(1)
       expected result to have changed by 1, but was changed by 0
     # ./spec/mysql2/statement_spec.rb:18:in `block (2 levels) in <top (required)>'
  3) Mysql2::Statement close should free server resources
     Failure/Error: expect { stmt.close }.to change(&method(:stmt_count)).by(-1)
       expected result to have changed by -1, but was changed by 0
     # ./spec/mysql2/statement_spec.rb:702:in `block (3 levels) in <top (required)>'
Finished in 11.87 seconds (files took 0.16723 seconds to load)
322 examples, 3 failures
```

2. Specify used package versions
# dnf list installed | grep -i -e maria -e mysql -e galera

<mock-chroot> sh-5.1# dnf list installed | grep -i -e maria -e mysql -e galera
mariadb.x86_64                            3:10.5.8-8.fc35                @fedora
mariadb-backup.x86_64                     3:10.5.8-8.fc35                @fedora
mariadb-common.x86_64                     3:10.5.8-8.fc35                @fedora
mariadb-connector-c.x86_64                3.1.11-2.fc34                  @fedora
mariadb-connector-c-config.noarch         3.1.11-2.fc34                  @fedora
mariadb-connector-c-devel.x86_64          3.1.11-2.fc34                  @fedora
mariadb-cracklib-password-check.x86_64    3:10.5.8-8.fc35                @fedora
mariadb-errmsg.x86_64                     3:10.5.8-8.fc35                @fedora
mariadb-gssapi-server.x86_64              3:10.5.8-8.fc35                @fedora
mariadb-server.x86_64                     3:10.5.8-8.fc35                @fedora
mariadb-server-utils.x86_64               3:10.5.8-8.fc35                @fedora
perl-DBD-MariaDB.x86_64                   1.21-10.fc34                   @fedora

3. Does a systemd journal say anything about the issue?
# journalctl -xe -u mariadb -u mysqld

# journalctl -xe -u mariadb -u mysqld
No journal files were found.
-- No entries --

4. Please check and attach the MariaDB or MySQL server log?  ("/var/log/mariadb/mariadb.log" or "/var/log/mysql/mysqld.log")

<mock-chroot> sh-5.1# cat /var/log/mariadb/mariadb.log
cat: /var/log/mariadb/mariadb.log: No such file or directory
<mock-chroot> sh-5.1# cat /var/log/mysql/mysqld.log
cat: /var/log/mysql/mysqld.log: No such file or directory

[mockbuild@9adaf472b7a54eda8cf28afa53c86c2c mysql2-0.5.3]$ pwd
/builddir/build/BUILD/mysql2-0.5.3/usr/share/gems/gems/mysql2-0.5.3

[mockbuild@9adaf472b7a54eda8cf28afa53c86c2c mysql2-0.5.3]$ cat mysql.log 
2021-02-17 14:21:03 0 [Note] InnoDB: Using Linux native AIO
2021-02-17 14:21:03 0 [Note] InnoDB: Uses event mutexes
2021-02-17 14:21:03 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-02-17 14:21:03 0 [Note] InnoDB: Number of pools: 1
2021-02-17 14:21:03 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2021-02-17 14:21:03 0 [Note] mysqld: O_TMPFILE is not supported on /var/tmp (disabling future attempts)
2021-02-17 14:21:03 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2021-02-17 14:21:03 0 [Note] InnoDB: Completed initialization of buffer pool
2021-02-17 14:21:03 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-02-17 14:21:03 0 [Note] InnoDB: 128 rollback segments are active.
2021-02-17 14:21:03 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-02-17 14:21:03 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-02-17 14:21:03 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2021-02-17 14:21:03 0 [Note] InnoDB: 10.5.8 started; log sequence number 45118; transaction id 20
2021-02-17 14:21:03 0 [Note] InnoDB: Loading buffer pool(s) from /builddir/build/BUILD/mysql2-0.5.3/usr/share/gems/gems/mysql2-0.5.3/data/ib_buffer_pool
2021-02-17 14:21:03 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-02-17 14:21:03 0 [Note] InnoDB: Buffer pool(s) load completed at 210217 14:21:03
2021-02-17 14:21:03 0 [Note] Server socket created on IP: '::'.
2021-02-17 14:21:03 0 [Note] Reading of all Master_info entries succeeded
2021-02-17 14:21:03 0 [Note] Added new Master_info '' to hash table
2021-02-17 14:21:03 0 [Note] /usr/libexec/mysqld: ready for connections.
Version: '10.5.8-MariaDB'  socket: '/builddir/build/BUILD/mysql2-0.5.3/usr/share/gems/gems/mysql2-0.5.3/mysql.sock'  port: 14228  MariaDB Server
2021-02-17 14:21:06 112 [Warning] Access denied for user 'asdfasdf8d2h'@'localhost' (using password: YES)
2021-02-17 14:21:07 186 [Warning] Aborted connection 186 to db: 'test' user: 'mockbuild' host: 'localhost' (Got an error reading communication packets)
2021-02-17 14:21:07 210 [Warning] Aborted connection 210 to db: 'test' user: 'mockbuild' host: 'localhost' (Got an error writing communication packets)
2021-02-17 14:21:10 250 [Warning] Aborted connection 250 to db: 'test' user: 'mockbuild' host: 'localhost' (Got an error reading communication packets)
2021-02-17 14:21:10 229 [Warning] Aborted connection 229 to db: 'test' user: 'mockbuild' host: 'localhost' (Got an error writing communication packets)
2021-02-17 14:21:10 232 [Warning] Aborted connection 232 to db: 'test' user: 'mockbuild' host: 'localhost' (Got an error writing communication packets)
2021-02-17 14:21:10 236 [Warning] Aborted connection 236 to db: 'test' user: 'mockbuild' host: 'localhost' (Got an error writing communication packets)
2021-02-17 14:21:11 237 [Warning] Aborted connection 237 to db: 'test' user: 'mockbuild' host: 'localhost' (Got an error writing communication packets)
2021-02-17 14:21:11 369 [Warning] Aborted connection 369 to db: 'test' user: 'mockbuild' host: 'localhost' (Got an error writing communication packets)

5. Please check and paste your configuration here; remove sensitive information.
# /usr/libexec/mysqld --print-defaults

[mockbuild@9adaf472b7a54eda8cf28afa53c86c2c mysql2-0.5.3]$ /usr/libexec/mysqld --print-defaults
/usr/libexec/mysqld would have been started with the following arguments:
--datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mariadb/mariadb.log --pid-file=/run/mariadb/mariadb.pid 

6. Can you reproduce this issue? If so, please provide the steps to reproduce the issue below:

```
$ fedpkg co rubygem-mysql2
$ cd rubygem-mysql2
$ git revert 6d35cbef77794eaacac9176958e50005d2daddbb
$ fedpkg srpm
$ mock -r fedora-rawhide-x86_64 rubygem-mysql2-0.5.3-7.fc35.src.rpm
```

Comment 1 Ben Cotton 2021-08-10 12:52:11 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 35 development cycle.
Changing version to 35.

Comment 2 Jun Aruga 2021-08-10 15:25:40 UTC
The test failures on rubygem-mysql2 came from the MariaDB 10.5 change.

1. `SELECT COUNT(1) AS count FROM performance_schema.prepared_statements_instances` returns 0 without error even when performance_schema is OFF on MariaDB 10.5

``
MariaDB [test]> SHOW VARIABLES LIKE 'performance_schema';
+--------------------+-------+
| Variable_name      | Value |
+--------------------+-------+
| performance_schema | OFF   |
+--------------------+-------+
1 row in set (0.002 sec)
```

2. An error message including Unicode was changed on MariaDB 10.5. 
  See <https://jira.mariadb.org/browse/MDEV-25400>.

On rubygem-mysql2, we could fix the test failures properly.
https://github.com/brianmario/mysql2/pull/1193


Note You need to log in before you can comment on or make changes to this bug.