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

Update SQLite to version 3.45.2 #1173

Merged
merged 2 commits into from
Apr 10, 2024
Merged

Update SQLite to version 3.45.2 #1173

merged 2 commits into from
Apr 10, 2024

Conversation

JoshuaWise
Copy link
Member

This is an automated pull request, updating SQLite to version 3.45.2.

@JoshuaWise JoshuaWise requested a review from a team as a code owner April 10, 2024 00:56
@mceachen
Copy link
Member

The failing test:

	it('should work with an empty database', async function () {
		this.db.close();
		this.db = new Database();
		const buffer = this.db.serialize();
		expect(buffer).to.be.an.instanceof(Buffer);
                writeFileSync("/tmp/empty.db", buffer);
		expect(buffer.length).to.equal(0);
		this.db.close();
		this.db = new Database(buffer);
		expect(this.db.serialize().length).to.equal(0);
	});

The new behavior of SQLite is to actually emit a valid SQLite database, complete with a proper magick header:

$ hexdump -c /tmp/empty.db 
0000000   S   Q   L   i   t   e       f   o   r   m   a   t       3  \0
0000010 020  \0 001 001  \0   @          \0  \0  \0  \0  \0  \0  \0 001
0000020  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
*
0000060  \0  \0  \0  \0  \r  \0  \0  \0  \0 020  \0  \0  \0  \0  \0  \0
0000070  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
*

I propose the assertion on empty databases should be modified to validate that there aren't any tables, and the buffer is less than or equal to 4096 bytes.

Note that this change isn't mentioned in the SQLite release notes: https://sqlite.org/releaselog/3_45_2.html

Copy link
Member

@mceachen mceachen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:+1

@mceachen mceachen merged commit ef6541b into master Apr 10, 2024
17 checks passed
@mceachen mceachen deleted the sqlite-update-3450200 branch April 10, 2024 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants