Update to the new signature of Result.Release() driver API.

[GB.DB.MYSQL]
* NEW: Update to the new signature of Result.Release() driver API.

[GB.DB.POSTGRESQL]
* NEW: Update to the new signature of Result.Release() driver API.

[GB.DB.SQLITE2]
* NEW: Update to the new signature of Result.Release() driver API.

[GB.DB.SQLITE3]
* NEW: Update to the new signature of Result.Release() driver API.
This commit is contained in:
gambas 2021-04-10 16:23:00 +02:00
parent 3677f9ef34
commit 50e3b33eaf
4 changed files with 418 additions and 414 deletions

View file

@ -1020,10 +1020,11 @@ static void query_init(DB_RESULT result, DB_INFO *info, int *count)
<result> is the handle of the query result.
<info> points to the info structure.
<invalid> tells if the associated connection has been closed.
*****************************************************************************/
static void query_release(DB_RESULT result, DB_INFO *info)
static void query_release(DB_RESULT result, DB_INFO *info, bool invalid)
{
mysql_free_result((MYSQL_RES *)result);
}
@ -1352,7 +1353,7 @@ static int rollback_transaction(DB_DATABASE *db)
This function must initialize the following info fields:
- info->nfield must contain the number of fields in the table.
- info->fields is a char*[] pointing at the name of each field.
- info->field is an array of DB_FIELD, one element for each field.
This function returns TRUE if the command has failed, and FALSE if
everything was OK.

View file

@ -1059,10 +1059,11 @@ static void query_init(DB_RESULT result, DB_INFO *info, int *count)
<result> is the handle of the query result.
<info> points to the info structure.
<invalid> tells if the associated connection has been closed.
*****************************************************************************/
static void query_release(DB_RESULT result, DB_INFO *info)
static void query_release(DB_RESULT result, DB_INFO *info, bool invalid)
{
PQclear((PGresult *)result);
}
@ -1424,7 +1425,7 @@ static int rollback_transaction(DB_DATABASE *db)
This function must initialize the following info fields:
- info->nfield must contain the number of fields in the table.
- info->fields is a char*[] pointing at the name of each field.
- info->field is an array of DB_FIELD, one element for each field.
This function returns TRUE if the command has failed, and FALSE if
everything was OK.

View file

@ -803,10 +803,11 @@ static void query_init(DB_RESULT result, DB_INFO *info, int *count)
<result> is the handle of the query result.
<info> points to the info structure.
<invalid> tells if the associated connection has been closed.
*****************************************************************************/
static void query_release(DB_RESULT result, DB_INFO *info)
static void query_release(DB_RESULT result, DB_INFO *info, bool invalid)
{
((Dataset *)result)->close();
}
@ -1078,7 +1079,7 @@ static int rollback_transaction(DB_DATABASE *db)
This function must initialize the following info fields:
- info->nfield must contain the number of fields in the table.
- info->fields is a char*[] pointing at the name of each field.
- info->field is an array of DB_FIELD, one element for each field.
This function returns TRUE if the command has failed, and FALSE if
everything was OK.

View file

@ -853,10 +853,11 @@ static void query_init(DB_RESULT result, DB_INFO * info, int *count)
<result> is the handle of the query result.
<info> points to the info structure.
<invalid> tells if the associated connection has been closed.
*****************************************************************************/
static void query_release(DB_RESULT result, DB_INFO * info)
static void query_release(DB_RESULT result, DB_INFO * info, bool invalid)
{
sqlite_query_free((SQLITE_RESULT *)result);
}
@ -1081,7 +1082,7 @@ static int rollback_transaction(DB_DATABASE * db)
This function must initialize the following info fields:
- info->nfield must contain the number of fields in the table.
- info->fields is a char*[] pointing at the name of each field.
- info->field is an array of DB_FIELD, one element for each field.
This function returns TRUE if the command has failed, and FALSE if
everything was OK.
@ -2195,7 +2196,7 @@ static int database_exist(DB_DATABASE *db, const char *name)
files within a designated directory. Propose that all
areas are walked through.
******************************************************************************/
******************************************************************************/
static int database_list(DB_DATABASE *db, char ***databases)
{
@ -2223,19 +2224,19 @@ static int database_list(DB_DATABASE *db, char ***databases)
}
/*****************************************************************************
*
* database_is_system()
*
* Returns if a database is a system database.
*
* <handle> is any database handle.
* <name> is the database name.
*
* This function returns TRUE if the database is a system database, and
* FALSE if not.
*
* Note: Sqlite doesn't have such a thing.
******************************************************************************/
*
* database_is_system()
*
* Returns if a database is a system database.
*
* <handle> is any database handle.
* <name> is the database name.
*
* This function returns TRUE if the database is a system database, and
* FALSE if not.
*
* Note: Sqlite doesn't have such a thing.
******************************************************************************/
static int database_is_system(DB_DATABASE * db, const char *name)
{
@ -2243,18 +2244,18 @@ static int database_is_system(DB_DATABASE * db, const char *name)
}
/*****************************************************************************
*
* database_delete()
*
* Deletes a database.
*
* <handle> is the database handle.
* <name> is the database name.
*
* This function returns TRUE if the command has failed, and FALSE if
* everything was OK.
*
******************************************************************************/
*
* database_delete()
*
* Deletes a database.
*
* <handle> is the database handle.
* <name> is the database name.
*
* This function returns TRUE if the command has failed, and FALSE if
* everything was OK.
*
******************************************************************************/
static int database_delete(DB_DATABASE * db, const char *name)
{
@ -2294,20 +2295,20 @@ static int database_delete(DB_DATABASE * db, const char *name)
}
/*****************************************************************************
*
* database_create()
*
* Creates a database.
*
* <handle> is the database handle.
* <name> is the database name.
*
* This function returns TRUE if the command has failed, and FALSE if
* everything was OK.
*
* SQLite automatically creates a database on connect if the file
* does not exist.
******************************************************************************/
*
* database_create()
*
* Creates a database.
*
* <handle> is the database handle.
* <name> is the database name.
*
* This function returns TRUE if the command has failed, and FALSE if
* everything was OK.
*
* SQLite automatically creates a database on connect if the file
* does not exist.
******************************************************************************/
static int database_create(DB_DATABASE *db, const char *name)
{
@ -2370,23 +2371,23 @@ _CREATE_DATABASE:
/*****************************************************************************
*
* user_exist()
*
* Returns if a user exists.
*
* <handle> is any database handle.
* <name> is the user name.
*
* This function returns TRUE if the user exists, and FALSE if not.
* Sqlite does not have different users. Access is controlled by
* access rightd on the file.
* We can check that the user exists on the machine and has access to
* database file!
* [Currently only checks against /etc/passwd.
* Does not check against /etc/shadow or pam.
*
******************************************************************************/
*
* user_exist()
*
* Returns if a user exists.
*
* <handle> is any database handle.
* <name> is the user name.
*
* This function returns TRUE if the user exists, and FALSE if not.
* Sqlite does not have different users. Access is controlled by
* access rightd on the file.
* We can check that the user exists on the machine and has access to
* database file!
* [Currently only checks against /etc/passwd.
* Does not check against /etc/shadow or pam.
*
******************************************************************************/
static int user_exist(DB_DATABASE *db, const char *name)
{
@ -2394,21 +2395,21 @@ static int user_exist(DB_DATABASE *db, const char *name)
}
/*****************************************************************************
*
* user_list()
*
* Returns an array containing the name of each user.
*
* <handle> is the database handle.
* <users> points to a variable that will receive the char* array.
*
* This function returns the number of users, or -1 if the command has
* failed.
*
* Be careful: <users> can be NULL, so that just the count is returned.
* Sqlite does not have users.
*
******************************************************************************/
*
* user_list()
*
* Returns an array containing the name of each user.
*
* <handle> is the database handle.
* <users> points to a variable that will receive the char* array.
*
* This function returns the number of users, or -1 if the command has
* failed.
*
* Be careful: <users> can be NULL, so that just the count is returned.
* Sqlite does not have users.
*
******************************************************************************/
static int user_list(DB_DATABASE * db, char ***users)
@ -2419,21 +2420,21 @@ static int user_list(DB_DATABASE * db, char ***users)
}
/*****************************************************************************
*
* user_info()
*
* Get user description
*
* <handle> is the database handle.
* <name> is the user name.
* <info> points to a structure filled by the function.
*
* This function returns TRUE if the command has failed, and FALSE if
* everything was OK.
*
* Sqlite privileges are just file privileges. We will return Admin
* rights where privilege allows Write. There is no password.
******************************************************************************/
*
* user_info()
*
* Get user description
*
* <handle> is the database handle.
* <name> is the user name.
* <info> points to a structure filled by the function.
*
* This function returns TRUE if the command has failed, and FALSE if
* everything was OK.
*
* Sqlite privileges are just file privileges. We will return Admin
* rights where privilege allows Write. There is no password.
******************************************************************************/
static int user_info(DB_DATABASE * db, const char *name, DB_USER * info)
{
@ -2464,21 +2465,21 @@ static int user_delete(DB_DATABASE * db, const char *name)
}
/*****************************************************************************
*
* user_create()
*
* Creates a user.
*
* <handle> is the database handle.
* <name> is the user name.
* <info> points to a structure describing the user.
*
* This function returns TRUE if the command has failed, and FALSE if
* everything was OK.
*
*
* Sqlite: No user create
******************************************************************************/
*
* user_create()
*
* Creates a user.
*
* <handle> is the database handle.
* <name> is the user name.
* <info> points to a structure describing the user.
*
* This function returns TRUE if the command has failed, and FALSE if
* everything was OK.
*
*
* Sqlite: No user create
******************************************************************************/
static int user_create(DB_DATABASE * db, const char *name, DB_USER * info)
{
@ -2487,20 +2488,20 @@ static int user_create(DB_DATABASE * db, const char *name, DB_USER * info)
}
/*****************************************************************************
*
* user_set_password()
*
* Change the user password.
*
* <handle> is the database handle.
* <name> is the user name.
* <password> is the new password
*
* This function returns TRUE if the command has failed, and FALSE if
* everything was OK.
*
* Sqlite : No user passwords.
******************************************************************************/
*
* user_set_password()
*
* Change the user password.
*
* <handle> is the database handle.
* <name> is the user name.
* <password> is the new password
*
* This function returns TRUE if the command has failed, and FALSE if
* everything was OK.
*
* Sqlite : No user passwords.
******************************************************************************/
static int user_set_password(DB_DATABASE * db, const char *name, const char *password)
{