1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-17 12:02:09 +03:00
Files
mariadb/sql
Alexander Barkov 350cc77fee MDEV-29968 Functions in default values in tables with some character sets break SHOW CREATE (and mysqldump)
Item:print_for_table_def() uses QT_TO_SYSTEM_CHARSET to print
the DEFAULT expression into FRM file during CREATE TABLE.
Therefore, the expression is encoded in utf8 in FRM.

get_field_default_value() erroneously used field->charset() to
print the DEFAULT expression at SHOW CREATE TABLE time.

Fixing get_field_default_value() to use &my_charset_utf8mb4_general_ci instead.
This makes DEFAULT work in the way way with:

- virtual column expressions:

    if (field->vcol_info)
    {
      StringBuffer<MAX_FIELD_WIDTH> str(&my_charset_utf8mb4_general_ci);
      field->vcol_info->print(&str);

- check constraint expressions:

    if (field->check_constraint)
    {
      StringBuffer<MAX_FIELD_WIDTH> str(&my_charset_utf8mb4_general_ci);
      field->check_constraint->print(&str);

Additional cleanup:
Fixing system_charset_info to &my_charset_utf8mb4_general_ci in a few
places to make non-BMP characters work in DEFAULT, virtual column,
check constraint expressions.
2025-01-17 15:39:55 +04:00
..
2023-11-08 12:59:00 +01:00
2021-04-20 12:30:09 +03:00
2024-08-12 09:32:30 +01:00
2024-10-28 15:29:10 +01:00
2023-01-27 13:54:14 +01:00
2022-04-21 15:33:50 +03:00
2023-08-15 11:10:27 +03:00
2025-01-14 18:56:13 +03:00
2025-01-14 18:56:13 +03:00
2025-01-14 18:56:13 +03:00
2023-02-10 12:02:11 +02:00
2024-11-23 08:14:22 -07:00
2021-10-13 12:03:32 +03:00
2023-11-08 12:59:00 +01:00
2023-11-08 12:59:00 +01:00
2024-11-23 08:14:22 -07:00
2021-04-21 07:25:48 +03:00
2023-02-10 12:02:11 +02:00
2024-04-15 17:46:49 +02:00
2022-06-09 12:22:55 +03:00
2022-10-02 14:38:13 +02:00
2023-02-10 12:02:11 +02:00
2022-10-25 11:26:37 +03:00
2023-12-02 01:02:50 +01:00
2023-12-02 01:02:50 +01:00
2023-07-20 11:54:52 +02:00
2023-02-10 12:02:11 +02:00
2023-02-10 12:02:11 +02:00
2024-11-23 08:14:22 -07:00
2023-02-10 12:02:11 +02:00
2024-11-23 08:14:22 -07:00
2024-12-04 18:22:31 +03:00
2023-05-02 10:09:27 +02:00
2024-11-23 08:14:22 -07:00
2023-11-08 12:59:00 +01:00
2024-11-23 08:14:22 -07:00
2024-11-23 08:14:22 -07:00
2022-12-13 14:39:18 +02:00
2021-08-18 18:22:35 +03:00
2023-02-10 12:02:11 +02:00
2022-08-02 16:35:15 +10:00
2024-11-23 08:14:22 -07:00
2024-11-23 08:14:22 -07:00
2022-11-30 13:10:52 +02:00
2024-01-10 18:01:46 +11:00
2024-01-10 18:01:46 +11:00
2024-11-23 08:14:22 -07:00
2021-06-30 18:41:46 +03:00
2024-02-12 11:38:13 +02:00
2021-01-06 10:53:00 +01:00
2024-11-23 08:14:22 -07:00
2024-11-23 08:14:23 -07:00
2024-06-05 14:06:16 +10:00
2024-04-15 18:54:30 +02:00
2024-12-17 09:52:32 +01:00
2021-03-05 12:54:43 +02:00
2024-07-03 12:45:30 +02:00
2023-12-02 01:02:50 +01:00
2023-12-02 01:02:50 +01:00
2022-09-05 13:28:56 +03:00
2023-12-02 01:02:50 +01:00
2021-02-23 09:25:57 +01:00
2022-10-02 14:38:13 +02:00
2021-09-17 19:57:13 +03:00
2023-12-02 01:02:50 +01:00
2023-09-25 13:06:57 +10:00
2023-07-20 11:54:52 +02:00
2024-11-23 08:14:22 -07:00
2024-11-23 08:14:23 -07:00
2024-01-10 18:01:46 +11:00
2025-01-07 16:46:43 +01:00
2022-08-10 12:24:31 +02:00
2023-12-02 01:02:50 +01:00
2024-01-10 18:01:46 +11:00
2024-11-23 08:14:22 -07:00
2023-02-10 12:02:11 +02:00
2024-02-12 11:38:13 +02:00
2023-01-03 17:08:42 +02:00
2023-02-10 12:02:11 +02:00
2022-09-05 13:28:56 +03:00
2023-12-22 00:10:23 +01:00
2022-06-27 10:14:37 +03:00
2024-01-03 12:07:51 +02:00
2023-12-21 11:30:32 +02:00
2021-04-08 07:47:49 +03:00
2024-11-23 08:14:22 -07:00