Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL] Update a column with null value fails #1173

Closed
ramkumarvs opened this issue Apr 8, 2019 · 1 comment
Closed

[YSQL] Update a column with null value fails #1173

ramkumarvs opened this issue Apr 8, 2019 · 1 comment
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug
Projects

Comments

@ramkumarvs
Copy link
Contributor

# create table foo (id bigint primary key, name varchar(255));
CREATE TABLE
# insert into foo (id, name) values(1, null);
# update foo set name = 'bar' where id = 1;
UPDATE 1
yugaware=# select * from foo;
 id | name
----+-------
  1 |
(1 row)
@m-iancu m-iancu added kind/bug This issue is a bug area/ysql Yugabyte SQL (YSQL) labels Apr 8, 2019
@ndeodhar ndeodhar assigned rajukumaryb and m-iancu and unassigned nocaway and rajukumaryb Apr 10, 2019
@m-iancu m-iancu added this to To do in YSQL via automation Apr 15, 2019
yugabyte-ci pushed a commit that referenced this issue Apr 16, 2019
Summary:
The root cause was an inconsistency between equality and inequality operators
for QLValue. The former was using CQL semantics (null equals null), while
the latter was using SQL semantics (null neither equals nor not-equals
anything -- i.e. would be unknown in a three-valued logic, but we mapped
unknown to false in C++).

The fix is to consistently use CQL semantics for QLValue.
For YSQL the 'query layer' is really the stateless postgres which compares
correctly with SQL semantics.
Later when we pushdown more expressions to be evaluated in DocDB we need to
consider either adding alternative comparators for SQL or using a different
class/protobuf message for YSQL values.
These follow-up tasks are tracked in:
#1138
#1141

Test Plan: TestPgRegressFeature.java (yb_feature_update.sql)

Reviewers: neil, robert, neha

Reviewed By: robert, neha

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D6475
@m-iancu
Copy link
Contributor

m-iancu commented Apr 17, 2019

Fixed in 4483c64.

@m-iancu m-iancu closed this as completed Apr 17, 2019
YSQL automation moved this from To do to Done Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/bug This issue is a bug
Projects
YSQL
  
Done
Development

No branches or pull requests

4 participants