diff --git a/migtests/tests/pg/datatypes/data-migration-report-live-migration-fallf.json b/migtests/tests/pg/datatypes/data-migration-report-live-migration-fallf.json index 5eee6a3d6..9e367e3aa 100644 --- a/migtests/tests/pg/datatypes/data-migration-report-live-migration-fallf.json +++ b/migtests/tests/pg/datatypes/data-migration-report-live-migration-fallf.json @@ -271,5 +271,44 @@ "exported_updates": 0, "exported_deletes": 0, "final_row_count": 2 + }, + { + "table_name": "public.\"null_and_default\"", + "db_type": "source", + "exported_snapshot_rows": 13, + "imported_snapshot_rows": 0, + "imported_inserts": 0, + "imported_updates": 0, + "imported_deletes": 0, + "exported_inserts": 2, + "exported_updates": 3, + "exported_deletes": 0, + "final_row_count": 15 + }, + { + "table_name": "public.\"null_and_default\"", + "db_type": "source-replica", + "exported_snapshot_rows": 0, + "imported_snapshot_rows": 13, + "imported_inserts": 2, + "imported_updates": 3, + "imported_deletes": 0, + "exported_inserts": 0, + "exported_updates": 0, + "exported_deletes": 0, + "final_row_count": 15 + }, + { + "table_name": "public.\"null_and_default\"", + "db_type": "target", + "exported_snapshot_rows": 13, + "imported_snapshot_rows": 0, + "imported_inserts": 2, + "imported_updates": 3, + "imported_deletes": 0, + "exported_inserts": 0, + "exported_updates": 0, + "exported_deletes": 0, + "final_row_count": 15 } ] \ No newline at end of file diff --git a/migtests/tests/pg/datatypes/pg_datatypes_data.sql b/migtests/tests/pg/datatypes/pg_datatypes_data.sql index dd06c6b87..b569357d9 100644 --- a/migtests/tests/pg/datatypes/pg_datatypes_data.sql +++ b/migtests/tests/pg/datatypes/pg_datatypes_data.sql @@ -48,8 +48,8 @@ VALUES "language" => "English", "ISBN-13" => "978-1449370000", "weight" => "11.2 ounces"'), - (hstore(ROW(1,'{\"key1=value1, key2=value2\"}'))), - (hstore('json_field', '{\"key1=value1, key2={\"key1=value1, key2=value2\"}\"}')), - (hstore('{"key1=value1, key2=value2"}', '{\"key1=value1, key2={\"key1=value1, key2=value2\"}\"}')), - (hstore('"{""key1"":""value1"",""key2"":""value2""}"', '{\"key1=value1, key2={\"key1=value1, key2=value2\"}\"}')), - (hstore('"{key1:value1,key2:value2}"', '{\"key1=value1, key2={\"key1=value1, key2=value2\"}\"}')); + (hstore(ROW(1,'{"key1=value1, key2=value2"}'))), + (hstore('json_field', '{"key1=value1, key2={"key1=value1, key2=value2"}"}')), --hstore() key and values need no extra processing + ('"{\"key1=value1, key2=value2\"}"=>"{\"key1=value1, key2={\"key1=value1, key2=value2\"}\"}"'), --single quotes string need to escaped properly + (hstore('"{""key1"":""value1"",""key2"":""value2""}"', '{"key1=value1, key2={"key1=value1, key2=value2"}"}')), + (hstore('"{key1:value1,key2:value2}"', '{"key1=value1, key2={"key1=value1, key2=value2"}"}')); diff --git a/migtests/tests/pg/datatypes/source_delta.sql b/migtests/tests/pg/datatypes/source_delta.sql index fdf99c796..a98a32d92 100644 --- a/migtests/tests/pg/datatypes/source_delta.sql +++ b/migtests/tests/pg/datatypes/source_delta.sql @@ -56,13 +56,17 @@ SET data = data || 'key3 => value3' WHERE id = 1; UPDATE hstore_example -SET data = hstore('{"key1=value1, key2=value2"}', '{\"key1=value1, key2={\"key1=value1, key2=value2\"}\"}') +SET data = hstore('{"key1=value1, key2=value2"}', '{"key1=value1, key2={"key1=value1, key2=value2"}"}') WHERE id = 3; +UPDATE hstore_example +SET data = '"{\"key1=value1, key2=value2\"}"=>"{\"key1=value1, key2={\"key1=value1, key2=value2\"}\"}"' +WHERE id = 7; + INSERT INTO hstore_example (data) VALUES ('key5 => value5, key6 => value6'); INSERT INTO hstore_example (data) VALUES - (hstore('{"key1=value1, key2=value2"}', '{\"key1=value1, key2={\"key1=value1, key2=value2\"}\"}')); + (hstore('{"key1=value1, key2=value2"}', '{"key1=value1, key2={"key1=value1, key2=value2"}"}')); diff --git a/migtests/tests/pg/datatypes/target_delta.sql b/migtests/tests/pg/datatypes/target_delta.sql index f235f4567..7eed5ed9b 100644 --- a/migtests/tests/pg/datatypes/target_delta.sql +++ b/migtests/tests/pg/datatypes/target_delta.sql @@ -62,16 +62,24 @@ SET v1 = '{"new": "data"}', v2 = B'1111000011', v5=B'001010100101010101010101010 DELETE FROM datatypes2 WHERE 5 = ANY(v3); -INSERT INTO hstore_example (data) -VALUES - ('key7 => value7, key8 => value8'); +-- INSERT INTO hstore_example (data) +-- VALUES +-- ('key7 => value7, key8 => value8'); -UPDATE hstore_example -SET data = delete(data, 'key2') -WHERE id = 8; +-- UPDATE hstore_example +-- SET data = delete(data, 'key2') +-- WHERE id = 8; -DELETE FROM hstore_example WHERE data ? 'key5'; +-- DELETE FROM hstore_example WHERE data ? 'key5'; -INSERT INTO hstore_example (data) -VALUES -(hstore('"{""key1"":""value1"",""key2"":""value2""}"', '{\"key1=value1, key2={\"key1=value1, key2=value2\"}\"}')); \ No newline at end of file +-- INSERT INTO hstore_example (data) +-- VALUES +-- (hstore('"{""key1"":""value1"",""key2"":""value2""}"', '{"key1=value1, key2={"key1=value1, key2=value2"}"}')); + +-- UPDATE hstore_example +-- SET data = hstore('{"key1=value1, key2=value2"}', '{"key1=value1, key2={"key1=value1, key2=value2"}"}') +-- WHERE id = 15; + +-- UPDATE hstore_example +-- SET data = '"{\"key1=value1, key2=value2\"}"=>"{\"key1=value1, key2={\"key1=value1, key2=value2\"}\"}"' +-- WHERE id = 14; diff --git a/migtests/tests/pg/datatypes/validateAfterChanges b/migtests/tests/pg/datatypes/validateAfterChanges index a05073ec0..cd8b55c54 100755 --- a/migtests/tests/pg/datatypes/validateAfterChanges +++ b/migtests/tests/pg/datatypes/validateAfterChanges @@ -29,7 +29,7 @@ EXPECTED_ROW_COUNT = { 'datetime_type2': 2, 'null_and_default' :2, 'decimal_types': 4, - 'hstore_example': 16, + 'hstore_example': 15, } EXPECTED_SUM_OF_COLUMN = { @@ -66,7 +66,7 @@ EXPECTED_ROW_COUNT_FF = { 'datetime_type2': 3, 'null_and_default' :2, 'decimal_types': 4, - 'hstore_example': 16, + 'hstore_example': 15, } EXPECTED_SUM_OF_COLUMN_FF = {