NULL values are exported as empty strings
-
Given the following table:
CREATE TABLEtesting(idint(11) NOT NULL AUTO_INCREMENT,contenttext DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;And the following data:
INSERT INTOtesting(content) VALUES (NULL);The plugin saves the following SQL to the backup archive:
/* CUSTOM VARS START */ /* REAL_TABLE_NAME:testing; */ /* PRE_TABLE_NAME:1675859812_testing; */ /* CUSTOM VARS END */ CREATE TABLE IF NOT EXISTS1675859812_testing(idint(11) NOT NULL AUTO_INCREMENT,contenttext, PRIMARY KEY (id)) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; INSERT INTO1675859812_testing(id,content) VALUES (1,'');That’s wrong. The data should be
VALUES (1,NULL)instead ofVALUES (1,'').This also causes errors in other plugins after the backup is restored. Such as this one: https://ww.wp.xz.cn/support/topic/migration-class-mailpoetmigrationsmigration_20221108_140545-not-found/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘NULL values are exported as empty strings’ is closed to new replies.
