Project

Profile

Help

Bug #5747

closed

sql:update function ignores the where-clause.

Added by Herbert Brückner almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Saxon extensions
Sprint/Milestone:
-
Start date:
2022-11-27
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
10, 11, trunk
Fix Committed on Branch:
10, 11, trunk
Fixed in Maintenance Release:
Platforms:
Java

Description

I am using Saxon 11.3 EE with Java 11 and an Oracle 19 database with the standard oracle jdbc driver. Now I found an unexpected behavior when I worked with the Saxon SQL functions. It seems that the sql:update function (and sql:prepared-statement as well) ignores the where-clause. A little example is appended to this mail.


Files

Example.xslt (1.1 KB) Example.xslt Test script Herbert Brückner, 2022-11-27 13:39
SQL_TEST.SQL (289 Bytes) SQL_TEST.SQL DB table for testing Herbert Brückner, 2022-11-27 13:39
Example2.xslt (1.29 KB) Example2.xslt Herbert Brückner, 2022-11-29 10:35
Actions #1

Updated by Michael Kay almost 2 years ago

Yes, looking at the code for sql:update, you are right, the predicate is ignored. (Haven't looked at that code for a very long time...)

I'm not sure about sql:prepared-statement though - that doesn't have a similar where-clause argument.

Actions #2

Updated by Herbert Brückner almost 2 years ago

  • File Example2.xslt added

Sorry, just to mention the sql:prepared-statement here is not comprehensible. In fact, my first try was to define an update-Statement using sql:prepared-statement. When I could'nt work it out, I started using the sql:update function. A little example using sql:prepared-statement for an update statement with unexpected results is now appended.

Actions #4

Updated by Herbert Brückner almost 2 years ago

Sorry, the first Upload (at 09:27) was a mistake - is there a way to delete the document?

Actions #5

Updated by Michael Kay almost 2 years ago

  • File deleted (Example2.xslt)
Actions #6

Updated by Michael Kay almost 2 years ago

Sorry for the delay in responding to this. It's taken me a while to get the SQL tests working again in my development environment (for a while now, we've only been running them in our automated build scripts, which makes debugging any problems difficult). I've now got the tests running and passing so should be able to start work on this bug.

Actions #7

Updated by Michael Kay almost 2 years ago

It looks as if our only test cases for the sql:update function are checking that the selected rows are updated, but are failing to check that unselected rows are left unchanged.

Actions #8

Updated by Michael Kay almost 2 years ago

  • Category set to Saxon extensions
  • Status changed from New to Resolved
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal
  • Applies to branch 10, 11, trunk added
  • Fix Committed on Branch 10, 11, trunk added
Actions #9

Updated by Michael Kay almost 2 years ago

  • Subject changed from sql:update function (and sql:prepared-statement as well) ignores the where-clause. to sql:update function ignores the where-clause.
Actions #10

Updated by Community Admin almost 2 years ago

  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 12.0 added

Bug issue fix applied in the Saxon 12.0 Major Release. Leaving this bug marked as Resolved until fix applied

Actions #11

Updated by O'Neil Delpratt almost 2 years ago

  • Fixed in Maintenance Release 11.5 added

Bug fix applied in the Saxon 11.5 maintenance release.

Actions #12

Updated by O'Neil Delpratt over 1 year ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 10.9 added

Bug fix applied in the Saxon 10.9 maintenance release.

Please register to edit this issue

Also available in: Atom PDF