mariadb/plugin
Alexander Barkov 9edb1a5ce3 MDEV-30483 After upgrade to 10.6 from Mysql 5.7 seeing "InnoDB: Column last_update in table mysql.innodb_table_stats is BINARY(4) NOT NULL but should be INT UNSIGNED NOT NULL"
Problem:

Field_timestampf implementations differ in MySQL and MariaDB:
- MariaDB sets the UNSIGNED_FLAG in Field::flags
- MySQL does not

The reference table structures
(defined in table_stats_schema and index_stats_schema)
expected the last_update column to have the DATA_UNSIGNED flag,
because MariaDB's Field_timestampf has the UNSIGNED_FLAG.
It worked fine on pure MariaDB installations.

However, if a MariaDB server starts over a MySQL-5.7 data directory during
a migration, the last_update column does not have DATA_UNSIGNED flag,
because MySQL's Field_timestampf does not have the UNSIGNED_FLAG.

This made InnoDB (after the migration from MySQL) complain into the server
error log about the unexpected data type.

The actual fix is done in storage/innobase/dict/dict0stats.cc:
It removes DATA_UNSIGNED from the prtype_mask member of the reference columns,
so now it does not require the underlying columns to have this flag.

The rest of the fix is needed for MTR tests.
The new data type plugin TYPE_MYSQL_TIMESTAMP implements a slightly modified
version of Field_timestampf, which removes the unsigned flag, so
it works like MySQL's Field_timestampf.

The MTR test ALTERs the data type of the columns
table_stats_schema.last_update and index_stats_schema.last_update
from TIMESTAMP to TYPE_MYSQL_TIMESTAMP, then makes InnoDB
verify the structure of the two statistics tables by creating
and populating an InnoDB table t1.

Without the fix made storage/innobase/dict/dict0stats.cc,
MTR complains about unexpected warnings in the server error log:

[ERROR] InnoDB: Column last_update in table mysql.innodb_table_stats is ...
[ERROR] InnoDB: Column last_update in table mysql.innodb_index_stats is ...

With the fix made storage/innobase/dict/dict0stats.cc these warnings
go away.
2023-05-25 05:25:39 +04:00
..
audit_null Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
auth_dialog Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
auth_ed25519 Merge 10.3 into 10.4 2021-05-25 15:38:57 +03:00
auth_examples Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
auth_gssapi update C/C, fix srpm build failures on fedora 2022-09-26 11:17:53 +02:00
auth_pam Merge remote-tracking branch '10.4' into 10.5 2023-03-31 21:32:41 +02:00
auth_pipe Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
auth_socket Early return from auth_socket system checks on Windows 2021-09-11 01:33:29 +02:00
aws_key_management Merge branch '10.4' into 10.5 2021-07-31 23:19:51 +02:00
cracklib_password_check move alloca() definition from all *.h files to one new header file 2023-03-07 11:13:20 +01:00
daemon_example perfschema memory related instrumentation changes 2020-03-10 19:24:22 +01:00
debug_key_management Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
disks Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
example_key_management Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
feedback Merge 10.5 into 10.6 2023-04-11 16:15:19 +03:00
file_key_management Merge 10.3 into 10.4 2022-10-25 10:04:37 +03:00
fulltext Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
func_test Added override to all releveant methods in Item (and a few other classes) 2021-05-19 22:27:53 +02:00
handler_socket move alloca() definition from all *.h files to one new header file 2023-03-07 11:13:20 +01:00
locale_info MDEV-22214 mariadbd.exe calls function mysqld.exe, and crashes 2020-04-10 19:05:26 +02:00
metadata_lock_info remove mysql_declare_plugin declaration from some plugins 2020-07-04 01:44:47 +02:00
qc_info Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
query_response_time Merge 10.5 into 10.6 2023-02-10 13:03:01 +02:00
server_audit Merge branch '10.5' into 10.6 2022-05-10 14:01:23 +02:00
simple_password_check Merge branch '10.3' into 10.4 2022-08-02 14:15:39 +02:00
sql_errlog Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
test_sql_service MDEV-19275 Provide SQL service to plugins. 2020-10-02 10:19:00 +04:00
type_geom change buitin plugin types from Alpha to Stable as needed 2020-08-07 13:36:11 +02:00
type_inet Merge remote-tracking branch '10.4' into 10.5 2023-03-31 21:32:41 +02:00
type_mysql_json Merge 10.5 into 10.6 2022-07-26 11:37:36 +03:00
type_mysql_timestamp MDEV-30483 After upgrade to 10.6 from Mysql 5.7 seeing "InnoDB: Column last_update in table mysql.innodb_table_stats is BINARY(4) NOT NULL but should be INT UNSIGNED NOT NULL" 2023-05-25 05:25:39 +04:00
type_test Merge remote-tracking branch 'origin/10.4' into 10.5 2022-09-14 16:24:51 +04:00
user_variables Merge 10.5 into 10.6 2022-09-20 16:53:20 +03:00
userstat Merge 10.4 into 10.5 2021-04-14 11:35:39 +03:00
versioning Merge 10.4 into 10.5 2023-02-10 12:02:11 +02:00
win_auth_client Merge 10.2 into 10.3 2021-07-22 18:57:54 +03:00
wsrep_info Merge branch '10.4' into 10.5 2022-10-02 14:38:13 +02:00