Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase the maximum possible value of the page size #494

Conversation

petterreinholdtsen
Copy link

Firefox/Iceweasel uses a page size of 32k, but sqlite won't allow it because the maximum it allows by default is 8k (through the SQLITE_MAX_DEFAULT_PAGE_SIZE define). This patch increases this limit.

Patch by Laszlo Boszormenyi (GCS) gcs@debian.org to solve Debian bug http://bugs.debian.org/672573 .

Patch has been used by Debian package for a while, see https://udd.debian.org/patches.cgi?src=sqlcipher&version=3.4.1-2 .

Firefox/Iceweasel uses a page size of 32k, but sqlite won't allow it
because the maximum it allows by default is 8k (through the
SQLITE_MAX_DEFAULT_PAGE_SIZE define). This patch increases this limit.

Patch by Laszlo Boszormenyi (GCS) <gcs@debian.org> to solve Debian bug
http://bugs.debian.org/672573 .

Patch has been used by Debian package for a while, see
https://udd.debian.org/patches.cgi?src=sqlcipher&version=3.4.1-2 .
@sjlombardo
Copy link
Member

Hello @petterreinholdtsen I have reviewed the description of this change and I don't think that this is applicable at all. The SQLITE_MAX_DEFAULT_PAGE_SIZE is only used to determine the max size that SQLite would be used by default based on device characteristics:

/*
** Ordinarily, if no value is explicitly provided, SQLite creates databases
** with page size SQLITE_DEFAULT_PAGE_SIZE. However, based on certain
** device characteristics (sector-size and atomic write() support),
** SQLite may choose a larger value. This constant is the maximum value
** SQLite will choose on its own.
*/

Having this set to 8K would not impact the ability of Firefox/Iceweasel to use a larger page size. SQLITE_MAX_DEFAULT_PAGE_SIZE doesn't prevent an application from explicitly selecting a large page size. The applicable maximum page size (SQLITE_MAX_PAGE_SIZE) is already set to 65536.

Furthermore, unless I am mistaken, Firefox is already using both SQLite and SQLCipher without these patches on other platforms.

I understand this patch has been used for some time but I believe it is misguided and wouldn't do what is purported.

@sjlombardo sjlombardo closed this Nov 12, 2023
@petterreinholdtsen
Copy link
Author

petterreinholdtsen commented Nov 13, 2023 via email

@sjlombardo
Copy link
Member

Hello @petterreinholdtsen - I reviewed the history and rationale of that change. In my opinion it would be best to remove that patch. It will not work as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants