0

I have a problem with MariaDB with a longtext field. It is limited to 32770 chars and there is no way to grow it up.

SELECT CHAR_LENGTH(longtext_column) from table where id = x;

I edited my cnf like this:

[mysqld]
max_allowed_packet     =  1000M

And I confirmed is ok running this query:

enter image description here

Anyway, I run an update query with more than 32770 characters and always truncate the text to 32770.

On the other hand, I red this on the official documentation:

The effective maximum length is less if the value contains multi-byte characters. The effective maximum length of LONGTEXT columns also depends on the configured maximum packet size in the client/server protocol and available memory.

Lastly, maybe useful information:

  1. The string I attempt to store is JSON.
  2. I tried on another server with the same result.
  3. I'm running Navicat to run these queries.

What am I missing?

Edit1: I have never got the MySQL Error 1153 - Got a packet bigger than 'max_allowed_packet' bytes error.

Edit 2: MySql version 15.1 Distrib 10.3.31-MariaDB

Edit 3: Text for SHOW CREATE TABLE tbl_name command (shortened to the concerning fields):

| table_name | CREATE TABLE `table_name` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `column_in_question` longtext COLLATE utf8_unicode_ci,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7498 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |

Edit4: I uploaded a MySql script I've using for test de 32KB limitation.

https://pastebin.com/NUw7Q1cE

JuliSmz
  • 996
  • 1
  • 12
  • 26
  • `LONGTEXT` fields are not limited, so it sounds like an issue with Navicat. Which version/edition of Navicat do you use? – Louis Jan 05 '22 at 17:41
  • The last one, version 16 for Linux... I have the same error running the query from Laravel / Eloquent... Both on code as on tinker console. – JuliSmz Jan 05 '22 at 17:49
  • I ran it also on mysql client console and same results... – JuliSmz Jan 05 '22 at 18:10
  • Can you paste the table DDL? – Louis Jan 05 '22 at 18:24
  • Which MariaDB Version do you use? – Louis Jan 05 '22 at 19:07
  • mysql Ver 15.1 Distrib 10.3.31-MariaDB – JuliSmz Jan 05 '22 at 20:22
  • [doesn't appear to be server side](https://dbfiddle.uk/?rdbms=mariadb_10.3&fiddle=35da0607c3720ed8cdb0c615da8b9e86). – danblack Jan 06 '22 at 02:28
  • Better yet, post TEXT results of SHOW CREATE TABLE 'yourtablename'; so we know how the table is viewed by MySQL at this time. Someone could have modified your intended data content, accidentally causing current limits to be enforced. – Wilson Hauck Jan 06 '22 at 15:26
  • Thanks @WilsonHauck, I created a new brand table on a new brand database with longtext field, and I ran the same luck... A friend of mine has not this error with pure (non mariadb) MySQL, and another friend of mine has the same issue as me with MariaDB... I'm installing pure MySQL to check it out. – JuliSmz Jan 06 '22 at 16:38
  • Please consider posting TEXT results of SHOW CREATE TABLE tbl_name; Thanks – Wilson Hauck Jan 06 '22 at 22:14
  • Thanks @WilsonHauck, info added to main post. – JuliSmz Jan 07 '22 at 15:52
  • I can confirm I have the same problem with pure MySQL V8... My RAM memory is 12GB. – JuliSmz Jan 07 '22 at 16:38
  • 1
    @JuliSmz Consider the content of this URL - https://database.guide/how-to-set-the-character-set-and-collation-of-a-column-in-mysql/ - with the example of NAMING 'character set' and 'collate'. Could it be they MUST BE paired? And are there multiple ways of dealing with unicode - mentioned in this URL - https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-conversion.html - just DEEPER details to consider. – Wilson Hauck Jan 08 '22 at 17:32

0 Answers0