From 9211a26f96dda5dbf5d2f59656a246a2ac5370e5 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 10 Jul 2018 15:18:45 +0200 Subject: change storage format of dynamic columns to JSON --- test/it_dbi.t | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'test') diff --git a/test/it_dbi.t b/test/it_dbi.t index 6a37637..ab70fae 100755 --- a/test/it_dbi.t +++ b/test/it_dbi.t @@ -10,7 +10,7 @@ $dbi->query('create temporary table it_dbi_test ( ID int not null auto_increment, x int, foo varchar(42), - dyncols LONGBLOB, + dyncols JSON, primary key(ID) );'); @@ -321,12 +321,13 @@ is( # Test saving/retrieving/matching values in dynamically created columns # $record = new it_dbi_test; -$record->replace(['ID' => 5, 'key1' => "val1"]); is($record->key1, "val1"); -$record->update(['key2' => "val2"]); is($record->key1, "val1"); is($record->key2, "val2"); -$record->update(['-key3' => "2*2"]); is($record->key1, "val1"); is($record->key2, "val2"); is($record->key3, 4); -$record->update(['key1' => "val0"]); is($record->key1, "val0"); is($record->key2, "val2"); is($record->key3, 4); -$record->replace(['ID' => 6, 'key4' => "val4"]); is($record->key4, "val4"); -$record->select(['key2' => "val2"]); is($record->key2, "val2"); is($record->key4, null, "clear previous fields"); +$record->replace(['ID' => 5, 'key1' => "val0'"]); is($record->key1, "val0'"); +$record->update(['key1' => "val1'"], ['key1' => "val0'"]); is($record->key1, "val1'"); +$record->update(['key2' => "val2'"]); is($record->key1, "val1'"); is($record->key2, "val2'"); +$record->update(['-key3' => "2*2"]); is($record->key1, "val1'"); is($record->key2, "val2'"); is($record->key3, 4); +$record->update(['key1' => "val0'"]); is($record->key1, "val0'"); is($record->key2, "val2'"); is($record->key3, 4); +$record->replace(['ID' => 6, 'key4' => "val4'"]); is($record->key4, "val4'"); +$record->select(['key2' => "val2'"]); is($record->key2, "val2'"); is($record->key4, null, "clear previous fields"); # # Test tracked update -- cgit v1.2.3