korlov42 commented on a change in pull request #9655: URL: https://github.com/apache/ignite/pull/9655#discussion_r771407292
########## File path: modules/calcite/src/test/sql/types/blob/test_blob.test_ignore ########## @@ -1,96 +1,106 @@ # name: test/sql/types/blob/test_blob.test # description: BLOB tests # group: [blob] -# Ignore https://issues.apache.org/jira/browse/IGNITE-15618 +# Ignore https://issues.apache.org/jira/browse/IGNITE-15123 statement ok PRAGMA enable_verification statement ok -CREATE TABLE blobs (b binary); +CREATE TABLE blobs (b varbinary); # Insert valid hex strings statement ok -INSERT INTO blobs VALUES('\xaa\xff\xaa'), ('\xAA\xFF\xAA\xAA\xFF\xAA'), ('\xAA\xFF\xAA\xAA\xFF\xAA\xAA\xFF\xAA') +INSERT INTO blobs VALUES(x'aaffaa'), (x'AAFFAAAAFFAA'), (x'AAFFAAAAFFAAAAFFAA') query T -SELECT * FROM blobs +SELECT * FROM blobs ORDER BY b Review comment: `ScriptRunner` supports an unordered comparison. You could simply define a query like `query T rowsort`. In that case all result will be sorted on a client side in a lexicographical order of an ASCII representation of the row. You could read more about it in a javadoc of `ScriptTestSuite`. I believe, it would be better to use unordered comparison than modify an original query. ########## File path: modules/calcite/src/test/sql/types/blob/test_blob.test_ignore ########## @@ -1,96 +1,106 @@ # name: test/sql/types/blob/test_blob.test # description: BLOB tests # group: [blob] -# Ignore https://issues.apache.org/jira/browse/IGNITE-15618 +# Ignore https://issues.apache.org/jira/browse/IGNITE-15123 statement ok PRAGMA enable_verification statement ok -CREATE TABLE blobs (b binary); +CREATE TABLE blobs (b varbinary); # Insert valid hex strings statement ok -INSERT INTO blobs VALUES('\xaa\xff\xaa'), ('\xAA\xFF\xAA\xAA\xFF\xAA'), ('\xAA\xFF\xAA\xAA\xFF\xAA\xAA\xFF\xAA') +INSERT INTO blobs VALUES(x'aaffaa'), (x'AAFFAAAAFFAA'), (x'AAFFAAAAFFAAAAFFAA') query T -SELECT * FROM blobs +SELECT * FROM blobs ORDER BY b ---- -\xAA\xFF\xAA -\xAA\xFF\xAA\xAA\xFF\xAA -\xAA\xFF\xAA\xAA\xFF\xAA\xAA\xFF\xAA +aaffaa +aaffaaaaffaa +aaffaaaaffaaaaffaa # Insert valid hex strings, lower case statement ok DELETE FROM blobs statement ok -INSERT INTO blobs VALUES('\xaa\xff\xaa'), ('\xaa\xff\xaa\xaa\xff\xaa'), ('\xaa\xff\xaa\xaa\xff\xaa\xaa\xff\xaa') +INSERT INTO blobs VALUES(x'aaffaa'), (x'aaffaaaaffaa'), (x'aaffaaaaffaaaaffaa') query T -SELECT * FROM blobs +SELECT * FROM blobs ORDER BY b Review comment: the same about ordering ########## File path: modules/calcite/src/test/sql/types/blob/test_blob.test_ignore ########## @@ -1,96 +1,106 @@ # name: test/sql/types/blob/test_blob.test # description: BLOB tests # group: [blob] -# Ignore https://issues.apache.org/jira/browse/IGNITE-15618 +# Ignore https://issues.apache.org/jira/browse/IGNITE-15123 statement ok PRAGMA enable_verification statement ok -CREATE TABLE blobs (b binary); +CREATE TABLE blobs (b varbinary); # Insert valid hex strings statement ok -INSERT INTO blobs VALUES('\xaa\xff\xaa'), ('\xAA\xFF\xAA\xAA\xFF\xAA'), ('\xAA\xFF\xAA\xAA\xFF\xAA\xAA\xFF\xAA') +INSERT INTO blobs VALUES(x'aaffaa'), (x'AAFFAAAAFFAA'), (x'AAFFAAAAFFAAAAFFAA') query T -SELECT * FROM blobs +SELECT * FROM blobs ORDER BY b ---- -\xAA\xFF\xAA -\xAA\xFF\xAA\xAA\xFF\xAA -\xAA\xFF\xAA\xAA\xFF\xAA\xAA\xFF\xAA +aaffaa +aaffaaaaffaa +aaffaaaaffaaaaffaa # Insert valid hex strings, lower case statement ok DELETE FROM blobs statement ok -INSERT INTO blobs VALUES('\xaa\xff\xaa'), ('\xaa\xff\xaa\xaa\xff\xaa'), ('\xaa\xff\xaa\xaa\xff\xaa\xaa\xff\xaa') +INSERT INTO blobs VALUES(x'aaffaa'), (x'aaffaaaaffaa'), (x'aaffaaaaffaaaaffaa') query T -SELECT * FROM blobs +SELECT * FROM blobs ORDER BY b ---- -\xAA\xFF\xAA -\xAA\xFF\xAA\xAA\xFF\xAA -\xAA\xFF\xAA\xAA\xFF\xAA\xAA\xFF\xAA +aaffaa +aaffaaaaffaa +aaffaaaaffaaaaffaa # Insert valid hex strings with number and letters statement ok DELETE FROM blobs statement ok -INSERT INTO blobs VALUES('\xaa1199'), ('\xaa1199aa1199'), ('\xaa1199aa1199aa1199') +INSERT INTO blobs VALUES(x'aa1199'), (x'aa1199aa1199'), (x'aa1199aa1199aa1199') query T -SELECT * FROM blobs +SELECT * FROM blobs ORDER BY b Review comment: and here ########## File path: modules/calcite/src/test/sql/types/blob/test_blob.test_ignore ########## @@ -1,96 +1,106 @@ # name: test/sql/types/blob/test_blob.test # description: BLOB tests # group: [blob] -# Ignore https://issues.apache.org/jira/browse/IGNITE-15618 +# Ignore https://issues.apache.org/jira/browse/IGNITE-15123 statement ok PRAGMA enable_verification statement ok -CREATE TABLE blobs (b binary); +CREATE TABLE blobs (b varbinary); # Insert valid hex strings statement ok -INSERT INTO blobs VALUES('\xaa\xff\xaa'), ('\xAA\xFF\xAA\xAA\xFF\xAA'), ('\xAA\xFF\xAA\xAA\xFF\xAA\xAA\xFF\xAA') +INSERT INTO blobs VALUES(x'aaffaa'), (x'AAFFAAAAFFAA'), (x'AAFFAAAAFFAAAAFFAA') query T -SELECT * FROM blobs +SELECT * FROM blobs ORDER BY b ---- -\xAA\xFF\xAA -\xAA\xFF\xAA\xAA\xFF\xAA -\xAA\xFF\xAA\xAA\xFF\xAA\xAA\xFF\xAA +aaffaa +aaffaaaaffaa +aaffaaaaffaaaaffaa # Insert valid hex strings, lower case statement ok DELETE FROM blobs statement ok -INSERT INTO blobs VALUES('\xaa\xff\xaa'), ('\xaa\xff\xaa\xaa\xff\xaa'), ('\xaa\xff\xaa\xaa\xff\xaa\xaa\xff\xaa') +INSERT INTO blobs VALUES(x'aaffaa'), (x'aaffaaaaffaa'), (x'aaffaaaaffaaaaffaa') query T -SELECT * FROM blobs +SELECT * FROM blobs ORDER BY b ---- -\xAA\xFF\xAA -\xAA\xFF\xAA\xAA\xFF\xAA -\xAA\xFF\xAA\xAA\xFF\xAA\xAA\xFF\xAA +aaffaa +aaffaaaaffaa +aaffaaaaffaaaaffaa # Insert valid hex strings with number and letters statement ok DELETE FROM blobs statement ok -INSERT INTO blobs VALUES('\xaa1199'), ('\xaa1199aa1199'), ('\xaa1199aa1199aa1199') +INSERT INTO blobs VALUES(x'aa1199'), (x'aa1199aa1199'), (x'aa1199aa1199aa1199') query T -SELECT * FROM blobs +SELECT * FROM blobs ORDER BY b ---- -\xAA1199 -\xAA1199aa1199 -\xAA1199aa1199aa1199 +aa1199 +aa1199aa1199 +aa1199aa1199aa1199 # Insert invalid hex strings (invalid hex chars: G, H, I) statement error -INSERT INTO blobs VALUES('\xGA\xFF\xAA') +INSERT INTO blobs VALUES(x'GAFFAA') # Insert invalid hex strings (odd # of chars) statement error -INSERT INTO blobs VALUES('\xA') +INSERT INTO blobs VALUES(x'A') statement error -INSERT INTO blobs VALUES('\xAA\xA') +INSERT INTO blobs VALUES(x'AAA') -statement error -INSERT INTO blobs VALUES('blablabla\x') +statement ok +DELETE FROM blobs -# BLOB with “non-printable” octets -statement error -SELECT 'abc �'::BYTEA; +# Implicit cast +statement ok +INSERT INTO blobs VALUES('blablabla') + +# BINARY with “non-printable” octets +statement ok +INSERT INTO blobs VALUES('abc �'::VARBINARY) -# BLOB null and empty values query T -SELECT ''::BLOB +SELECT b::varchar FROM blobs ORDER BY b +---- +abc � +blablabla + +# BINARY null and empty values +query T +SELECT ''::VARBINARY ---- (empty) query T -SELECT NULL::BLOB +SELECT NULL::VARBINARY ---- NULL statement ok CREATE TABLE blob_empty (b binary); statement ok -INSERT INTO blob_empty VALUES(''), (''::BLOB) +INSERT INTO blob_empty VALUES(''), (''::VARBINARY) statement ok -INSERT INTO blob_empty VALUES(NULL), (NULL::BLOB) +INSERT INTO blob_empty VALUES(NULL), (NULL::VARBINARY) query T -SELECT * FROM blob_empty +SELECT * FROM blob_empty ORDER BY b Review comment: and here -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
