Skip to content

Commit

Permalink
MDEV-27691: make working view-protocol
Browse files Browse the repository at this point in the history
Update tests for version 10.7
  • Loading branch information
mariadb-lenastartseva committed Sep 27, 2022
1 parent 410a072 commit cee61e3
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
27 changes: 27 additions & 0 deletions mysql-test/main/func_sformat.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,33 @@ select sformat(0);
select sformat('C');
select sformat(-4.2);
select sformat(5, 5, 5);
#enable after fix MDEV-27871
--disable_view_protocol
select sformat('{} {}', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
--enable_view_protocol
select sformat('{{{}}}', 0);
select sformat('{{{}{{', 0);
select sformat('{{{{{}{{', 'param1');
select sformat(' {{ {{ {} {{ ', 'param1');
select sformat(' {{ {} {}', 'param1', 'param2');
select sformat('A{}C{}E{}', 'B', 'D', 'F');
select sformat('{} {}', FALSE, TRUE);
#enable after fix MDEV-29601
--disable_service_connection
select sformat('Add € != {} != {}?', '$', '£');
select sformat('Check {} != {} != {}?', '€', '$', '£');
--enable_service_connection
select sformat('{}{}{}', 1, 2, 3);
select sformat('Float {} Boolean {} Number {}', 3.14159, True, -50);
select sformat('SUM {} + {} = {}', 2, 3, 2+3);
select sformat('Numbers {} {} {}', 1, 1.11, 1.111);
select sformat('what {} is {}?', 'time', 'it');
#enable after fix MDEV-27871
--disable_view_protocol
select sformat('{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}
Expand All @@ -54,6 +62,7 @@ select sformat('{} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {
'85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100',
'101', '102', '103', '104', '105', '106', '107', '108', '109', '110', '111', '112', '113', '114',
'115', '116', '117', '118', '119', '120');
--enable_view_protocol

echo #;
echo # Error Test Cases;
Expand Down Expand Up @@ -83,7 +92,10 @@ insert into t2 values (0.0025, 25, 'A', DATE('2020-06-29')),
(0.0005, 5, 'B', DATE('2020-6-29')),
(5.5555, -5, 'C', DATE('200629')),
(-9, -9, 'D', DATE('20*06*29'));
#enable after fix MDEV-27871
--disable_view_protocol
select sformat('p1 {:.4f} p2 {} p3 {} p4 {}', param1, param2, param3, param4) from t2;
--enable_view_protocol
drop table t2;

set names utf8;
Expand Down Expand Up @@ -115,7 +127,10 @@ echo #;
echo # Format Test Cases;
echo #;
select sformat('Num {:L}', 13800000000);
#enable after fix MDEV-29646
--disable_view_protocol
select sformat('Num [{:20}]', 42);
--enable_view_protocol
select sformat('Number: {:*^{}}', 4, 5);
select sformat('{:02} - {:02} - {:02}', 1, 2, 3);
select sformat('Character {:c}', 104);
Expand All @@ -126,7 +141,10 @@ select sformat('Float {:.2f}', 42.0);
select sformat('Float {:f}', 42.0);
select sformat('Number {:d}', 42);
select sformat('Number {:{}}', 5, 5);
#enable after fix MDEV-29646
--disable_view_protocol
select sformat('Number [{:10}]', 9999);
--enable_view_protocol
select sformat('Number {:.3}', 3.1416);
select sformat('int: {0:d}; hex: {0:x}; oct: {0:o}', 42);
select sformat('int: {0:d}; hex: {0:#x}; oct: {0:#o}', 42);
Expand All @@ -137,10 +155,16 @@ select sformat('The binary version of {0} is {0:b}', 5);
select sformat('{:+f}; {:+f}', 3.14, -3.14);
select sformat('{: f}; {: f}', 3.14, -3.14);
select sformat('{:-f}; {:-f}', 3.14, -3.14);
#enable after fix MDEV-27871
--disable_view_protocol
select sformat('The temperature is between {: } and {: } degrees celsius.', -3, 7);
select sformat('The temperature is between {:-} and {:-} degrees celsius.', -3, 7);
select sformat('The temperature is between {:+} and {:+} degrees celsius.', -3, 7);
--enable_view_protocol
#check after fix MDEV-29646
--disable_view_protocol
select sformat('We have {:<8} chickens.', 49);
--enable_view_protocol
select sformat('Center alimgn [{:*^10}]', 'data');
select sformat('Center aling [{:^10}].', 'data');
select sformat('Right aling [{:>10}].', 'data');
Expand Down Expand Up @@ -195,7 +219,10 @@ echo #;
select sformat('={}=', _ucs2 x'006100620063');
set names utf8;
select sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442');
#enable after fix MDEV-27871
--disable_view_protocol
select hex(sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442'));
--enable_view_protocol
create table t1 as select sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442') as x;
show create table t1;
drop table t1;
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/main/json_equals.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ select json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3, 4]}');

select json_equals('{"a":[1, 2, 3]}', '{"a":[1, 2, 3]}');

#enable after fix MDEV-27871
--disable_view_protocol
select json_equals('{"țanțoș":[1, 2, "ț", {"some uâ߀":"uâßr"}]}',
'{"țanțoș":[1, 2, "ț", {"some uâ߀":"uâßr"}]}');

select json_equals('{"a" : [0.123456789123456789], "b" : [1, 2, 3]}',
'{"b" : [1, 2, 3], "a" : [0.123456789123456789]}');
--enable_view_protocol

--echo #
--echo # Test max json depth for json_equals.
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/main/type_decimal.test
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,10 @@ DROP TABLE t1dec102;

SELECT CAST('0e111111111' AS DECIMAL(38,0)) AS a;
SELECT CAST('0e1111111111' AS DECIMAL(38,0)) AS a;
#enable after fix MDEV-29647
--disable_view_protocol
SELECT CAST('.00000000000000000000000000000000000001e111111111111111111111' AS DECIMAL(38,0)) AS a;
--disable_view_protocol

CREATE TABLE t1 (str VARCHAR(128), comment VARCHAR(128));
INSERT INTO t1 VALUES
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/main/type_enum.test
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,13 @@ CREATE OR REPLACE TABLE t2 AS SELECT COALESCE(c_int, c_enum) FROM t1;
SHOW CREATE TABLE t2;
DROP TABLE t2;

--disable_view_protocol
--disable_ps_protocol
--enable_metadata
SELECT c_int FROM t1 UNION SELECT c_enum FROM t1;
SELECT COALESCE(c_int, c_enum) FROM t1;
--disable_metadata
--enable_ps_protocol
--enable_view_protocol

DROP TABLE t1;
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/main/type_set.test
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,13 @@ CREATE OR REPLACE TABLE t2 AS SELECT COALESCE(c_int, c_set) FROM t1;
SHOW CREATE TABLE t2;
DROP TABLE t2;

--disable_view_protocol
--disable_ps_protocol
--enable_metadata
SELECT c_int FROM t1 UNION SELECT c_set FROM t1;
SELECT COALESCE(c_int, c_set) FROM t1;
--disable_metadata
--enable_ps_protocol
--enable_view_protocol

DROP TABLE t1;

0 comments on commit cee61e3

Please sign in to comment.