SQLite

View Ticket
Login
2019-05-14
20:25
Fix a problem with the fix for [9cf6c9bb51] (commit [658b84d7]) that could cause a cursor to be left in an invalid state following a (rowid < text-value) search. (check-in: bc7d2c1656 user: dan tags: trunk)
2019-05-08
14:03 Ticket [9cf6c9bb51] "<" or "<=" comparison of rowid and non-numeric text value sometimes gets the wrong answer. status still Closed with 4 other changes (artifact: bbfde8a2e2 user: drh)
11:54 Ticket [9cf6c9bb51]: 3 changes (artifact: 8cbc48333c user: dan)
11:53 Closed ticket [9cf6c9bb51]. (artifact: 4ec82a65a6 user: dan)
11:52
Fix VDBE opcodes OP_SeekLT and OP_SeekLE so that they work on intkey tables with non-numeric text values. Fix for [9cf6c9bb]. (check-in: 658b84d7f4 user: dan tags: trunk)
11:40 Ticket [9cf6c9bb51] "<" or "<=" comparison of rowid and non-numeric text value sometimes gets the wrong answer. status still Open with 6 other changes (artifact: 4622d12dc3 user: dan)
11:37 New ticket [9cf6c9bb51]. (artifact: c18df1c460 user: dan)

Ticket Hash: 9cf6c9bb51e53bded445bedb200de5cb516ce867
Title: "<" or "<=" comparison of rowid and non-numeric text value sometimes gets the wrong answer.
Status: Closed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-05-08 14:03:50
6.17 years ago
Created: 2019-05-08 11:37:44
6.17 years ago
Version Found In:
User Comments:
dan added on 2019-05-08 11:37:44:

In the following, the second SELECT statement returns 0 rows:

  CREATE TABLE t14(x INTEGER PRIMARY KEY);
  INSERT INTO t14(x) VALUES (100);
  SELECT * FROM t14 WHERE x < 'a' ORDER BY rowid ASC;
  SELECT * FROM t14 WHERE x < 'a' ORDER BY rowid DESC;


dan added on 2019-05-08 11:40:33:

This has been a problem since before version 3.8.0.


dan added on 2019-05-08 11:54:06:

Fixed by [658b84d7].


drh added on 2019-05-08 14:03:50:

This problem was originally reported on the SQLite mailing list by Manuel Rigger.

The original problem report used PRAGMA reverse_unordered_selects. However, as the script above shows, the problem has nothing to do with reverse_unordered_selects. The problem was a defect in the implementation of some of the (rarely used) comparison opcodes in the bytecode engine.