Ignition 8.3.3, 'ACME' is a valid db connection.
Microsoft SQLServer db driver.
There is no table x, y, or z.
This throws an exception as expected:
query = 'select y from x where z is null'
system.db.runPrepQuery(query, [], 'ACME')
Specifically, it passes back: Invalid object name 'x'.
This does not return an error of any kind:
query = 'update x set y=1 where z is null'
system.db.runPrepUpdate(query, [], 'ACME')
Any ideas?
-Shane
Interestingly, the old deprecated runUpdateQuery
query = 'update x set y=1 where z is null'
system.db.runUpdateQuery(query, 'ACME')
throws as expected with the same error: Invalid object name 'x'.
Testing these in SSMS also generates the same error.
Sounds like a bug worth reporting.
Well, it's not code I wrote at least, but it is code I reviewed...
The bug is that as of 8.3.0, system.db.runPrepUpdate called with an empty args list short-circuits and doesn't even attempt to run your query.
If you put an actual argument in the args list, even one that's not actually used in your query, it'll throw as you expect.
This "feels" like a pretty important bug.
Do you think it might make it into 8.3.4?
I've done what I can, as far as prioritization, but it may not make it before the release train leaves the station on Friday.
Also, just adding an unused param doesn’t really work because then it throws for that…
Well, that's up to your JDBC driver/DB settings, it's out of our hands at that point.
I'm not disagreeing with you that this is a bad bug, and I'm certainly trying to get it fixed for 8.3.4. I just want to temper expectations.