server-beta icon indicating copy to clipboard operation
server-beta copied to clipboard

[BUG]: Sqlite logging no output

Open ZantetsukenGT opened this issue 2 years ago • 0 comments

Description

Setting both logging.log_sqlite and logging.log_sqlite_queries to true in config.json won't log any query in runtime.

Legacy server.cfg db_logging 1 and db_log_queries 1 won't work either.

How to re-produce this bug

  1. Generate default config.json
  2. Set both logging.log_sqlite and logging.log_sqlite_queries to true
  3. Generate an empty sqlite database named my-db.db and place it in scriptfiles/
  4. Compile the code below and run it
#include <a_samp>

#define db_query_and_free(%0) db_free_result(db_query(g_DBHandle, %0))

main() {}

public OnGameModeInit()
{
	new DB: g_DBHandle = db_open("my-db.db");
	printf("g_DBHandle %d", _:g_DBHandle);

	db_query_and_free("SELECT 'Hello world 1'");
	db_free_result(db_query(g_DBHandle, "SELECT 'Hello world 3'"));
}

Relevant log output

open.mp logs

[Info] g_DBHandle 1

sa-mp logs

g_DBHandle 1
[db_log_queries]: SELECT 'Hello world 1'
[db_log_queries]: SELECT 'Hello world 3'

open.mp server version

beta 10

Operating system or distribution

up to date Windows 10

Contact information

discord: Zantetsuken#2220

ZantetsukenGT avatar Dec 03 '22 04:12 ZantetsukenGT