Skip to content

Commit 1817e45

Browse files
authored
Add SQLITE_ENABLE_COLUMN_METADATA and update SQLite (#2948)
## Motivation for the change, related issues Our SQLite builds don't set the `SQLITE_ENABLE_COLUMN_METADATA` flag, which results in some metadata missing when [`PDOStatement::getColumnMeta`](https://www.php.net/manual/en/pdostatement.getcolumnmeta.php) is used. This results in issues like missing row editing controls in phpMyAdmin and possibly other problems. This flag seems to be set in most libsqlite3 builds: https://www.rogerbinns.com/blog/sqlite-configuration.html Therefore, I think it's safe to add it and, from the SQLite side, assume that it's always used. ## Implementation details I added the flag, updated SQLite, rebuilt it, and rebuilt all PHP builds. ## Testing Instructions (or ideally a Blueprint) I added tests for the `SQLITE_ENABLE_COLUMN_METADATA` and they need to pass.
1 parent 8232be3 commit 1817e45

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+3804
-1642
lines changed

packages/php-wasm/compile/libsqlite3/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ RUN if [ "$JSPI" = "1" ]; then \
1515

1616

1717
RUN set -euxo pipefail &&\
18-
wget --no-check-certificate https://www.sqlite.org/2022/sqlite-autoconf-3400100.tar.gz && \
19-
tar -xzvf sqlite-autoconf-3400100.tar.gz && \
20-
mv sqlite-autoconf-3400100 sqlite-src && \
18+
wget --no-check-certificate https://sqlite.org/2025/sqlite-autoconf-3510000.tar.gz && \
19+
tar -xzvf sqlite-autoconf-3510000.tar.gz && \
20+
mv sqlite-autoconf-3510000 sqlite-src && \
2121
cd sqlite-src && \
2222
source /root/emsdk/emsdk_env.sh && \
23+
export CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_USE_URI" && \
2324
emconfigure ./configure \
24-
--build i386-pc-linux-gnu \
25-
--target wasm32-unknown-emscripten \
25+
--build=i386-pc-linux-gnu \
26+
--host=wasm32-unknown-emscripten \
2627
--prefix=/root/lib/ && \
2728
export JSPI_FLAGS=$(if [ "$JSPI" = "1" ]; then echo "-sSUPPORT_LONGJMP=wasm -fwasm-exceptions"; else echo ""; fi) && \
2829
export EMCC_SKIP="-lc"; \

packages/php-wasm/compile/libsqlite3/asyncify/dist/root/lib/include/sqlite3.h

Lines changed: 1530 additions & 456 deletions
Large diffs are not rendered by default.

packages/php-wasm/compile/libsqlite3/asyncify/dist/root/lib/include/sqlite3ext.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,19 @@ struct sqlite3_api_routines {
359359
const char *(*db_name)(sqlite3*,int);
360360
/* Version 3.40.0 and later */
361361
int (*value_encoding)(sqlite3_value*);
362+
/* Version 3.41.0 and later */
363+
int (*is_interrupted)(sqlite3*);
364+
/* Version 3.43.0 and later */
365+
int (*stmt_explain)(sqlite3_stmt*,int);
366+
/* Version 3.44.0 and later */
367+
void *(*get_clientdata)(sqlite3*,const char*);
368+
int (*set_clientdata)(sqlite3*, const char*, void*, void(*)(void*));
369+
/* Version 3.50.0 and later */
370+
int (*setlk_timeout)(sqlite3*,int,int);
371+
/* Version 3.51.0 and later */
372+
int (*set_errmsg)(sqlite3*,int,const char*);
373+
int (*db_status64)(sqlite3*,int,sqlite3_int64*,sqlite3_int64*,int);
374+
362375
};
363376

364377
/*
@@ -685,6 +698,18 @@ typedef int (*sqlite3_loadext_entry)(
685698
#define sqlite3_db_name sqlite3_api->db_name
686699
/* Version 3.40.0 and later */
687700
#define sqlite3_value_encoding sqlite3_api->value_encoding
701+
/* Version 3.41.0 and later */
702+
#define sqlite3_is_interrupted sqlite3_api->is_interrupted
703+
/* Version 3.43.0 and later */
704+
#define sqlite3_stmt_explain sqlite3_api->stmt_explain
705+
/* Version 3.44.0 and later */
706+
#define sqlite3_get_clientdata sqlite3_api->get_clientdata
707+
#define sqlite3_set_clientdata sqlite3_api->set_clientdata
708+
/* Version 3.50.0 and later */
709+
#define sqlite3_setlk_timeout sqlite3_api->setlk_timeout
710+
/* Version 3.51.0 and later */
711+
#define sqlite3_set_errmsg sqlite3_api->set_errmsg
712+
#define sqlite3_db_status64 sqlite3_api->db_status64
688713
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
689714

690715
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
Binary file not shown.

packages/php-wasm/compile/libsqlite3/asyncify/dist/root/lib/lib/libsqlite3.la

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
libsqlite3.so.0.8.6
1+
libsqlite3.so.3.51.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
libsqlite3.so.0.8.6
1+
libsqlite3.so.3.51.0
Binary file not shown.
Binary file not shown.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Package Information for pkg-config
22

3-
prefix=/root/lib
3+
prefix=/root/lib/
44
exec_prefix=${prefix}
55
libdir=${exec_prefix}/lib
66
includedir=${prefix}/include
77

88
Name: SQLite
99
Description: SQL database engine
10-
Version: 3.40.1
10+
Version: 3.51.0
1111
Libs: -L${libdir} -lsqlite3
12-
Libs.private:
12+
Libs.private:
1313
Cflags: -I${includedir}

0 commit comments

Comments
 (0)