3 -- all inputs are silently truncated at NAMEDATALEN-1 (63) characters
5 -- fixed-length by reference
6 SELECT name 'name string' = name 'name string' AS "True";
12 SELECT name 'name string' = name 'name string ' AS "False";
21 CREATE TABLE NAME_TBL(f1 name);
22 INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR');
23 INSERT INTO NAME_TBL(f1) VALUES ('1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqr');
24 INSERT INTO NAME_TBL(f1) VALUES ('asdfghjkl;');
25 INSERT INTO NAME_TBL(f1) VALUES ('343f%2a');
26 INSERT INTO NAME_TBL(f1) VALUES ('d34aaasdf');
27 INSERT INTO NAME_TBL(f1) VALUES ('');
28 INSERT INTO NAME_TBL(f1) VALUES ('1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ');
29 SELECT '' AS seven, * FROM NAME_TBL;
31 -------+-----------------------------------------------------------------
32 | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
33 | 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
38 | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
41 SELECT '' AS six, c.f1 FROM NAME_TBL c WHERE c.f1 <> '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
43 -----+-----------------------------------------------------------------
44 | 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
51 SELECT '' AS one, c.f1 FROM NAME_TBL c WHERE c.f1 = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
53 -----+-----------------------------------------------------------------
54 | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
55 | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
58 SELECT '' AS three, c.f1 FROM NAME_TBL c WHERE c.f1 < '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
64 SELECT '' AS four, c.f1 FROM NAME_TBL c WHERE c.f1 <= '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
66 ------+-----------------------------------------------------------------
67 | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
69 | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
72 SELECT '' AS three, c.f1 FROM NAME_TBL c WHERE c.f1 > '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
74 -------+-----------------------------------------------------------------
75 | 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
81 SELECT '' AS four, c.f1 FROM NAME_TBL c WHERE c.f1 >= '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQR';
83 ------+-----------------------------------------------------------------
84 | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
85 | 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
89 | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
92 SELECT '' AS seven, c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*';
94 -------+-----------------------------------------------------------------
95 | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
96 | 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
101 | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
104 SELECT '' AS zero, c.f1 FROM NAME_TBL c WHERE c.f1 !~ '.*';
109 SELECT '' AS three, c.f1 FROM NAME_TBL c WHERE c.f1 ~ '[0-9]';
111 -------+-----------------------------------------------------------------
112 | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
113 | 1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq
116 | 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCDEFGHIJKLMNOPQ
119 SELECT '' AS two, c.f1 FROM NAME_TBL c WHERE c.f1 ~ '.*asdf.*';