-- bigistore istore_io should persist istores;
CREATE TABLE istore_io1 AS SELECT '-2147483647 => 10, -10 => -9223372036854775807, 0 => 5, 10 => 9223372036854775806, 2147483647 => 10'::bigistore;
SELECT * FROM istore_io1;
-- bigistore istore_io should persist istores;
CREATE TABLE istore_io2 AS SELECT '"-1"=>"+1","1"=>"2"'::bigistore;
SELECT * FROM istore_io2;
-- bigistore istore_io should persist istores;
CREATE TABLE istore_io3 AS SELECT ' "-1"=>"+1","1"=>"2"'::bigistore;
SELECT * FROM istore_io3;
-- bigistore istore_io should persist empty istores;
CREATE TABLE istore_io4 AS SELECT ''::bigistore;
SELECT * FROM istore_io4;
-- bigistore istore_io should turn istore to json;
SELECT istore_to_json('-2147483647 => 10, -10 => -9223372036854775807, 0 => 5, 10 => 9223372036854775806, 2147483647 => 10'::bigistore);
-- bigistore istore_io invalid input should report invalid value input;
SELECT '2=>4, 1=>foo, 5=>17'::bigistore;
-- bigistore istore_io invalid input should report invalid value input;
SELECT '2=>4, 1=>5foo, 5=>17'::bigistore;
-- bigistore istore_io invalid input should report to big value input;
SELECT '2=>4, 1=>18446744073709551612, 5=>17'::bigistore;
-- bigistore istore_io invalid input should report to small value input;
SELECT '2=>4, 1=>-18446744073709551614, 5=>17'::bigistore;
-- bigistore istore_io invalid input should report invalid key input;
SELECT '2=>4, 54foo=>5, 5=>17'::bigistore;
-- bigistore istore_io invalid input should report invalid key input;
SELECT '2=>4, foo=>5, 5=>17'::bigistore;
-- bigistore istore_io invalid input should report to big key input;
SELECT '2=>4, 4000000000=>5, 5=>17'::bigistore;
-- bigistore istore_io invalid input should report to small key input;
SELECT '2=>4, -4000000000=>5, 5=>17'::bigistore;
-- bigistore istore_io invalid input should report invalid delimiter input;
SELECT '2=>4, 10=5, 5=>17'::bigistore;
-- bigistore istore_io invalid input should report unexpected end of line;
SELECT '1=>2,2='::bigistore;
-- bigistore istore_io array input should parse normal arrays tuple;
SELECT '([1,2], [11, 22])'::bigistore;
-- bigistore istore_io array input should parse normal arrays tuple with spaces;
SELECT '([1, 2] ,[ 11, 22])'::bigistore;
-- bigistore istore_io array input should parse normal small arrays tuple;
SELECT '([1],[11])'::bigistore;
-- bigistore istore_io array input should parse normal empty arrays tuple;
SELECT '([],[])'::bigistore;
-- bigistore istore_io array invalid input should report unexpected end of line;
SELECT '([1,2], ['::bigistore;
-- bigistore istore_io array invalid input should report expected comma in values;
SELECT '([1,2], [1'::bigistore;
-- bigistore istore_io array invalid input should report expected number;
SELECT '([1,2], [1,'::bigistore;
-- bigistore istore_io array invalid input should report on uneven tuples;
SELECT '([1,2], [1,2,3])'::bigistore;
-- bigistore istore_io array invalid input should report on uneven tuples;
SELECT '([1,2,3],[1,2])'::bigistore;
-- bigistore istore_io array invalid input should report arrays delimiter;
SELECT '([1,2]|[1,2])'::bigistore;
-- bigistore istore_io array invalid input should report on ending bracket;
SELECT '([1,2],[1,2]'::bigistore;
-- bigistore istore_io array invalid input should report integer out of range;
SELECT '([2147483648], [1])'::bigistore;
-- bigistore istore_io arrays row input should create bigistore from row;
SELECT row_to_bigistore((array[1,2], array[11, 22]));
-- bigistore istore_io arrays row input should create bigistore from row with int8 keys;
SELECT row_to_bigistore((array[1::int8,2::int8], array[11, 22]));
-- bigistore istore_io arrays row input should fail on other kind of rows (case 1);
SELECT row_to_bigistore((array[1,2], array[11, 22], array[1,2]));
-- bigistore istore_io arrays row input should fail on other kind of rows (case 2);
SELECT row_to_bigistore((array[1,2], 'qwerty'));
-- bigistore istore_io arrays row input should fail on other kind of rows (case 3);
SELECT row_to_bigistore((array[1,2], array['1', '2']));
-- bigistore istore_io arrays row input should fail on integer overflow (INT_MAX);
SELECT row_to_bigistore((array[4147483647,2], array[11, 22]));
-- bigistore istore_io arrays row input should fail on integer overflow (INT_MIN);
SELECT row_to_bigistore((array[-4147483648,2], array[11, 22]));
-- istore istore_io should persist istores;
CREATE TABLE istore_io5 AS SELECT '-2147483647 => 10, -10 => -2147483647, 0 => 5, 10 => 2147483647, 2147483647 => 10'::istore;
SELECT * FROM istore_io5;
-- istore istore_io should persist istores;
CREATE TABLE istore_io6 AS SELECT '"-1"=>"+1","1"=>"2"'::istore;
SELECT * FROM istore_io6;
-- istore istore_io should persist istores;
CREATE TABLE istore_io7 AS SELECT ' "-1"=>"+1","1"=>"2"'::istore;
SELECT * FROM istore_io7;
-- istore istore_io should persist empty istores;
CREATE TABLE istore_io8 AS SELECT ''::istore;
SELECT * FROM istore_io8;
-- istore istore_io should turn istore to json;
SELECT istore_to_json('-2147483647 => 10, -10 => -2147483647, 0 => 5, 10 => 2147483647, 2147483647 => 10'::istore);
-- istore istore_io invalid input should report invalid value input;
SELECT '2=>4, 1=>foo, 5=>17'::istore;
-- istore istore_io invalid input should report invalid value input;
SELECT '2=>4, 1=>5foo, 5=>17'::istore;
-- istore istore_io invalid input should report to big value input;
SELECT '2=>4, 1=>4294967294, 5=>17'::istore;
-- istore istore_io invalid input should report to small value input;
SELECT '2=>4, 1=>-4294967294, 5=>17'::istore;
-- istore istore_io invalid input should report invalid key input;
SELECT '2=>4, 54foo=>5, 5=>17'::istore;
-- istore istore_io invalid input should report invalid key input;
SELECT '2=>4, foo=>5, 5=>17'::istore;
-- istore istore_io invalid input should report to big key input;
SELECT '2=>4, 4000000000=>5, 5=>17'::istore;
-- istore istore_io invalid input should report to small key input;
SELECT '2=>4, -4000000000=>5, 5=>17'::istore;
-- istore istore_io invalid input should report invalid delimiter input;
SELECT '2=>4, 10=5, 5=>17'::istore;
-- istore istore_io invalid input should report unexpected end of line;
SELECT '1=>2,2='::istore;
-- istore istore_io array input should parse normal arrays tuple;
SELECT '([1,2], [11, 22])'::istore;
-- istore istore_io array input should parse normal arrays tuple with spaces;
SELECT '([1, 2] ,[ 11, 22])'::istore;
-- istore istore_io array input should parse normal small arrays tuple;
SELECT '([1],[11])'::istore;
-- istore istore_io array input should parse normal empty arrays tuple;
SELECT '([],[])'::istore;
-- istore istore_io array invalid input should report unexpected end of line;
SELECT '([1,2], ['::istore;
-- istore istore_io array invalid input should report expected comma in values;
SELECT '([1,2], [1'::istore;
-- istore istore_io array invalid input should report expected number;
SELECT '([1,2], [1,'::istore;
-- istore istore_io array invalid input should report on uneven tuples;
SELECT '([1,2], [1,2,3])'::istore;
-- istore istore_io array invalid input should report on uneven tuples;
SELECT '([1,2,3],[1,2])'::istore;
-- istore istore_io array invalid input should report arrays delimiter;
SELECT '([1,2]|[1,2])'::istore;
-- istore istore_io array invalid input should report on ending bracket;
SELECT '([1,2],[1,2]'::istore;
-- istore istore_io array invalid input should report integer out of range;
SELECT '([2147483648], [1])'::istore;
-- istore istore_io arrays row input should create istore from row;
SELECT row_to_istore((array[1,2], array[11, 22]));
-- istore istore_io arrays row input should create istore from row with int8 keys;
SELECT row_to_istore((array[1::int8,2::int8], array[11, 22]));
-- istore istore_io arrays row input should fail on other kind of rows (case 1);
SELECT row_to_istore((array[1,2], array[11, 22], array[1,2]));
-- istore istore_io arrays row input should fail on other kind of rows (case 2);
SELECT row_to_istore((array[1,2], 'qwerty'));
-- istore istore_io arrays row input should fail on other kind of rows (case 3);
SELECT row_to_istore((array[1,2], array['1', '2']));
-- istore istore_io arrays row input should fail on integer overflow (INT_MAX);
SELECT row_to_istore((array[4147483647,2], array[11, 22]));
-- istore istore_io arrays row input should fail on integer overflow (INT_MIN);
SELECT row_to_istore((array[-4147483648,2], array[11, 22]));
-- istore should not fail on consecutive call of strtol
select id, '1=>1'::bigistore from (values (2147483648)) v(id);
select id, '1=>1'::bigistore from (values (2147483648)) v(id);
