SQLite Forum

bug report: an assert() in zipfile.c that may fail
Login
Hello,

This may cause SQLite fail to execute:

```
-- SQLite version 3.35.5
CREATE TABLE v0 ( v1 INT, v2 VARCHAR(200)) ;
INSERT INTO v0 ( v1) VALUES ( 9223372036854775807) ;
SELECT DISTINCT zipfile ( v1 , v1 , v1, v2 ) FROM v0 ;
```

> sqlite3: zipfileMtimeToDos: Assertion `mUnixTime<315507600 || mUnixTime==zipfileMtime(pCds) || ((mUnixTime % 2) && mUnixTime-1==zipfileMtime(pCds))' failed.

The code that triggers this error is as follows:

```c
  assert( mUnixTime<315507600 
       || mUnixTime==zipfileMtime(pCds) 
       || ((mUnixTime % 2) && mUnixTime-1==zipfileMtime(pCds)) 
       /* || (mUnixTime % 2) */
  );
```

Hope this issue will be handled properly :)