Skip to content

Commit e989612

Browse files
committed
BUG28627768: JSON_REPLACE NOT WORKING CORRECTLY FOR SQL TABLES
This patch adds a test case for JSON_REPLACE usege, which requires the use of mysql.expr method to correctly evaluate an expresion.
1 parent 87f5523 commit e989612

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/mysqlx/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License, version 2.0, as

tests/test_mysqlx_crud.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2527,6 +2527,11 @@ def test_update(self):
25272527
result = statement.where( "name = 'Barney' or name = 'Betty'").execute()
25282528
assert (2 == result.get_affected_items_count())
25292529

2530+
statement = table.update()
2531+
statement.set("info", mysqlx.expr("JSON_REPLACE(info, '$.married', False)"))
2532+
result = statement.where( "name = 'Fred' or name = 'Wilma'").execute()
2533+
assert (2 == result.get_affected_items_count())
2534+
25302535
drop_table(self.schema, "test")
25312536

25322537
def test_delete(self):

0 commit comments

Comments
 (0)