Ограничение размера строки MariaDB, применяемое в Windows, но не в Linux

#mariadb

Вопрос:

Если я запускаю следующий код в Maria для Windows, он завершается с ошибкой «ОШИБКА 1118 (42000): слишком большой размер строки», что достаточно справедливо, учитывая документированные ограничения

 C:DevelopmentYADAMU>mysql -uroot -poracle -hyadamu-db3 -P3307
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 788
Server version: 5.5.5-10.6.4-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2021, 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> SET AUTOCOMMIT = 0, TIME_ZONE = ' 00:00',SESSION INTERACTIVE_TIMEOUT = 600000, WAIT_TIMEOUT = 600000, SQL_MODE='ANSI_QUOTES,PAD_CHAR_TO_FULL_LENGTH', GROUP_CONCAT_MAX_LEN = 1024000, GLOBAL LOCAL_INFILE = 'ON';  /* Manager */
Query OK, 0 rows affected (0.00 sec)

mysql> --
mysql> drop table if exists "t_postgres1"."binary_types";
Query OK, 0 rows affected, 1 warning (0.05 sec)

mysql> --
mysql> create table if not exists "t_postgres1"."binary_types"(
    ->   "bytea_col" varbinary(5),
    ->   "bool_col" tinyint(1),
    ->   "bit_col" varchar(32767),
    ->   "bit_varying_col" varchar(32767),
    ->   "bit_8_col" varchar(32767),
    ->   "bit_varying_64_col" varchar(32767)
    -> );
ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
mysql>
mysql> exit
Bye
 

За исключением того факта, что если запустить точно такой же SQL для экземпляра MariaDB в Linux, работающего в последнем опубликованном контейнере, он работает

 C:DevelopmentYADAMU>mysql -uroot -poracle -P3307
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 116
Server version: 5.5.5-10.6.4-MariaDB-1:10.6.4 maria~focal mariadb.org binary distribution

Copyright (c) 2000, 2021, 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> SET AUTOCOMMIT = 0, TIME_ZONE = ' 00:00',SESSION INTERACTIVE_TIMEOUT = 600000, WAIT_TIMEOUT = 600000, SQL_MODE='ANSI_QUOTES,PAD_CHAR_TO_FULL_LENGTH', GROUP_CONCAT_MAX_LEN = 1024000, GLOBAL LOCAL_INFILE = 'ON';  /* Manager */
Query OK, 0 rows affected (0.00 sec)

mysql> --
mysql> drop table if exists "t_postgres1"."binary_types";
Query OK, 0 rows affected (0.02 sec)

mysql> --
mysql> create table if not exists "t_postgres1"."binary_types"(
    ->   "bytea_col" varbinary(5),
    ->   "bool_col" tinyint(1),
    ->   "bit_col" varchar(32767),
    ->   "bit_varying_col" varchar(32767),
    ->   "bit_8_col" varchar(32767),
    ->   "bit_varying_64_col" varchar(32767)
    -> );
Query OK, 0 rows affected, 4 warnings (0.03 sec)

mysql>
mysql>
 

Чего мне здесь не хватает?

Комментарии:

1. Что SHOW VARIABLES LIKE 'default_storage_engine' отображается в каждом из экземпляров?

2. INNODB в обоих случаях…

3. Просматривая весь вывод переменных show, самое большое различие, которое я мог видеть, — это языковые настройки.. В образе Docker (Linux) используется utf8mb4, а в образе Windows используется latin1. Мне нужно использовать Unicode для обоих, поэтому я потренируюсь, как переключить набор символов в моем образе Windows, и повторите попытку.. Я надеюсь, что это не причина этого…..

4. Это была ошибка, см.: jira.mariadb.org/browse/MCOL-713

5. ошибка была упомянута в примечаниях к выпуску версии 5.5.28a, см.: mariadb.com/kb/en/mariadb-5528a-changelog «Редакция #2661.817.81 Пт 2012-08-31 15:42:00 0530 Ошибка #13453036 КОД ОШИБКИ 1118: СЛИШКОМ БОЛЬШОЙ РАЗМЕР СТРОКИ, ХОТЯ ЭТО НЕ ТАК».

Ответ №1:

Что ж, спасибо @[sticky bit] за то, что указал мне правильное направление и заставил меня увидеть, что у меня были определены разные наборы символов. Как только я переключил версию Windows на «utf8mb4», оператор работает в обоих случаях.

Я не уверен, что хочу спросить, почему на данный момент, поскольку это позволяет мне продолжить регрессионное тестирование Windows…