Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: text字段插入报错, titan目录无文件
7.6.0 ARM
Inserting data into the text field reports ERROR 1048 (23000): Column ‘pad’ cannot be null. Additionally, with Titan enabled, after inserting 2 pieces of data, there are no files in the Titan directory.

I saw Titan again in a daze.
The default storage engine in 7.6.
In version 7.6.0, fields longer than 32K are placed inside Titan.
I just checked.
-
The reason you don’t see the file in Titan is because the written data is still in the cache and hasn’t actually been flushed to disk. You can write more data to see the effect.
-
The second issue, ERROR 1048 (23000): Column ‘pd’ cannot be null, still occurs even with Titan disabled. It might be a bug in TiDB, where it cannot handle data exceeding a certain length.
mysql> select lpad('a',6553555,'a');
+-----------------------+
| lpad('a',6553555,'a') |
+-----------------------+
| NULL |
+-----------------------+
1 row in set (0.05 sec)
I checked that lpad is null, and in MySQL 5.7 it is also null, with a prompt saying “Result of lpad() was larger than max_allowed_packet (4194304) - truncated.” In MySQL 8.0, it can return the expected string. This is a compatibility issue between MySQL and TiDB, and you can file an issue to track it.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.