MyBB Community Forums

Full Version: [F] SQLite version [C-StefanT]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I just tried to install on SQLite 3.3.7, I had the choice of SQLite 3 on the database details page, but on the table creation page, it said the database engine was SQLite 4. Minor thing but I don't know if it now thinks it's using SQLite 4 or 3.
I can reproduce this on the SQLite 3.3.7.
Just FYI, in ./inc/config.php it says the database type in sqlite3, it's just on the table creation page it shows up as being 4 instead of 3.
I'm not 100% on this to be honest, but I think this could be PHP's problem. During the install, the database version isn't set - it's retrieved using ATTR_SERVER_VERSION, which means it's just displaying what your server is telling it too. I think (I can't find it at the minute) there was a bug with this returning incorrect values in some versions of PHP.
I believe ATTR_SERVER_VERSION talks about the SQLite API version, not the actual SQlite release version.

If there is a better way we can display the version, then we should use that.
Just noticed the ACP home also says the SQL Engine is SQLite 4.

Just for clarity:
  • I have SQLite 3.3.7
  • The database details page in the installer gives the option of SQLite 3
  • The table creation page says SQLite 4
  • ./inc/config.php says SQLite 3
  • The ACP home page says SQLite 4
I believe this is the correct implementation on MyBB's end. Unless there is a "better" way of telling the "version" of SQLite installed, this is currently the best way.

Quote: PDO::ATTR_SERVER_VERSION (integer)
This is a read only attribute; it will return information about the version of the database server to which PDO is connected.
http://php.net/manual/en/pdo.constants.php
I haven't looked at the code, but

$ php -a
Interactive shell

php > $pdo = new PDO("sqlite:/tmp/foo.db");
php > var_dump($pdo->getAttribute(PDO::ATTR_CLIENT_VERSION));
string(6) "3.6.16"
php > var_dump($pdo->getAttribute(PDO::ATTR_SERVER_VERSION));
string(6) "3.6.16"

(this result is correct, and I get the same result when putting those lines in a foo.php that I run via the webserver)

But in MyBB install it shows this:

Quote:Table Creation

Connection to the database server and table you specified was successful.

Database Engine: SQLite 4

Huh
Actually your right - Why is it saying SQLite 4 - that doens't even exist yet. Maybe a typo on my part.
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group