Skip to content

Commit 3024f8a

Browse files
fix(joblist): MCOL-6218 null safe operator now handles string literals for a specific edge case.
1 parent ff9621d commit 3024f8a

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

dbcon/execplan/simplecolumn.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ class SimpleColumn : public ReturnedColumn
337337
double getDoubleVal(rowgroup::Row& row, bool& isNull) override
338338
{
339339
evaluate(row, isNull);
340+
if (isNull)
341+
{
342+
return 0;
343+
}
340344
return TreeNode::getDoubleVal();
341345
}
342346

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
DROP DATABASE IF EXISTS mcol6218;
2+
CREATE DATABASE mcol6218;
3+
USE mcol6218;
4+
CREATE TABLE person (
5+
name VARCHAR(100) NOT NULL,
6+
surname VARCHAR(100) DEFAULT NULL
7+
) ENGINE=Columnstore
8+
DEFAULT CHARSET=utf8mb3
9+
COLLATE=utf8mb3_general_ci;
10+
INSERT INTO person (name, surname) VALUES
11+
('Warren Baby', NULL),
12+
('Charlie', 'Parker'),
13+
('Oscar', 'Peterson');
14+
SELECT * FROM person WHERE surname <=> 1;
15+
name surname
16+
drop table person;
17+
DROP DATABASE mcol6218;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
-- source ../include/have_columnstore.inc
2+
3+
--disable_warnings
4+
DROP DATABASE IF EXISTS mcol6218;
5+
--enable_warnings
6+
7+
CREATE DATABASE mcol6218;
8+
9+
USE mcol6218;
10+
11+
CREATE TABLE person (
12+
name VARCHAR(100) NOT NULL,
13+
surname VARCHAR(100) DEFAULT NULL
14+
) ENGINE=Columnstore
15+
DEFAULT CHARSET=utf8mb3
16+
COLLATE=utf8mb3_general_ci;
17+
18+
INSERT INTO person (name, surname) VALUES
19+
('Warren Baby', NULL),
20+
('Charlie', 'Parker'),
21+
('Oscar', 'Peterson');
22+
23+
SELECT * FROM person WHERE surname <=> 1;
24+
25+
drop table person;
26+
DROP DATABASE mcol6218;

0 commit comments

Comments
 (0)