You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting this error with SQLite from io.requery:sqlite-android:3.33.0 but everything works fine with the android framework SQLite. Can you help me understand what's the issue or possibly investigate the issue with requery sqlite?
Here is the setup:
CREATE TABLE `ProductItem` (`productId` INTEGER NOT NULL, `itemId` INTEGER NOT NULL,
PRIMARY KEY(`posId`, `productionDepartmentId`),
FOREIGN KEY(`productId`) REFERENCES `Product`(`id`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY(`itemId`) REFERENCES `Item`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )
CREATE TABLE `_UpdateTime` (`id` INTEGER NOT NULL,`field` INTEGER NOT NULL,`time` INTEGER NOT NULL DEFAULT (CAST((julianday('now') - 2440587.5)*86400000000 AS INTEGER)),`modifier` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`id`,`field`))
CREATE TRIGGER tracking_ProductItem_on_insert AFTER INSERT ON `ProductItem` FOR EACH ROW BEGIN
INSERT OR REPLACE INTO `_UpdateTime` (`id`, `field`) VALUES (NEW.ROWID, 6900);
END
Query:
INSERT INTO `ProductItem` (`productId`, `itemId`) VALUES (2, 1)
Error:
E/SQLiteLog: (1555) abort at 25 in [INSERT OR ABORT INTO ProductItem(`productId`,`itemId`) VALUES (?,?)]: UNIQUE constraint failed: _UpdateTime.id, _UpdateTime.field
As you can see from the error message, the error occurs in the trigger, and the error suggests that a record with the same composite key exists (productId, itemId) - (2,1), but this should not happen on INSERT OR REPLACE. Actually, this doesn't happen on other sqlite builds i have tried (framework sqlite and some other custom builds), and doesn't happen all the time.
As i noticed the issue appears when the record is inserted, deleted, and inserted again.
When i pull the database from the Android device after the error appeared and try to open with DB Browser for SQLite or sqlite 3.33 , the query executes successfully
The text was updated successfully, but these errors were encountered:
I am getting this error with SQLite from io.requery:sqlite-android:3.33.0 but everything works fine with the android framework SQLite. Can you help me understand what's the issue or possibly investigate the issue with requery sqlite?
Here is the setup:
Query:
Error:
As you can see from the error message, the error occurs in the trigger, and the error suggests that a record with the same composite key exists (productId, itemId) - (2,1), but this should not happen on INSERT OR REPLACE. Actually, this doesn't happen on other sqlite builds i have tried (framework sqlite and some other custom builds), and doesn't happen all the time.
As i noticed the issue appears when the record is inserted, deleted, and inserted again.
When i pull the database from the Android device after the error appeared and try to open with DB Browser for SQLite or sqlite 3.33 , the query executes successfully
The text was updated successfully, but these errors were encountered: