Hello,
I've noticed strange behavior using Interactive SQL. I've made a sample script to reproduce the issue. Firstly, we have to create a table and a function that updates that table:
CREATE TABLE IF NOT EXISTS _tmp_t ( t_id INTEGER PRIMARY KEY DEFAULT AUTOINCREMENT, t_time TIMESTAMP ); CREATE OR REPLACE FUNCTION _sp_update_tmp_t() RETURNS INTEGER NOT DETERMINISTIC BEGIN UPDATE _tmp_t SET t_time = CURRENT TIMESTAMP; RETURN 1; END;
Then insert one record:
INSERT INTO _tmp_t (t_time) VALUES (CURRENT TIMESTAMP); COMMIT;
Then check and remember the newly inserted value:
SELECT * FROM _tmp_t;
Next, try to update the value by calling the function that we created above:
SELECT _sp_update_tmp_t(); COMMIT;
Surprisingly (at least, to me), the value is still the same. But if I try to call the function without a COMMIT and then COMMIT separately, the value changes as expected. Also, the value changes if I remove the semicolon after the function call (before the COMMIT):
SELECT _sp_update_tmp_t() COMMIT;
Can such behavior be explained somehow or is it a bug?
Server (and client): SA16 latest EBF (1691), the same behavior with SA12 and SA11 (not latest EBFs). Platform: Windows.
Thanks.
Request clarification before answering.
Despite the fact that Mike (here) was able to recreate the behaviour, I too, like Breck, could not.
I've tried this both ways on 12.0.1 and 16 ... and get different times each time ... The latest script Arthoor provided returns this result (from my latest run): t_number,t_time 1, '2014-01-16 12:18:05.252' 2, '2014-01-16 12:18:10.322'
So that would only seem to leave some machine specific behaviour or some option setting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just an issue of unfitting options - at least it doesn't fall into the CNR category:)
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.