/* Copyright (c) 2004-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "ioloop.h"
#include "str.h"
#include "sql-api-private.h"
#include <time.h>
struct default_sql_prepared_statement {
char *query_template;
};
void sql_drivers_init(void)
{
}
void sql_drivers_deinit(void)
{
}
{
unsigned int i, count;
for (i = 0; i < count; i++) {
return drivers[i];
}
return NULL;
}
{
i_fatal("sql_driver_register(%s): Already registered",
}
}
{
unsigned int i, count;
for (i = 0; i < count; i++) {
break;
}
}
}
{
else
return db;
}
{
}
{
}
{
break;
case SQL_DB_STATE_CONNECTING:
return 0;
default:
return 1;
}
/* don't try reconnecting more than once a second */
return -1;
}
{
}
{
}
{
}
{
}
{
}
{
}
static struct sql_prepared_statement *
const char *query_template)
{
}
static void
{
(struct default_sql_prepared_statement *)_prep_stmt;
}
static struct sql_statement *
{
(struct default_sql_prepared_statement *)_stmt;
}
{
const char *const *args;
if (arg_pos >= args_count ||
i_panic("lib-sql: Missing bind for arg #%u in statement: %s",
}
} else {
}
}
if (arg_pos != args_count) {
i_panic("lib-sql: Too many bind args (%u) for statement: %s",
}
}
static void
{
}
static struct sql_result *
{
return result;
}
struct sql_statement *stmt,
unsigned int *affected_rows)
{
}
struct sql_prepared_statement *
{
else
}
{
*_prep_stmt = NULL;
else
}
static void
{
}
struct sql_statement *
{
else {
}
return stmt;
}
struct sql_statement *
{
return stmt;
}
{
}
{
}
unsigned int column_idx, const char *value)
{
const char *escaped_value =
}
unsigned int column_idx, const void *value,
{
const char *value_str =
value, value_size);
}
}
{
}
{
else
}
{
else
return default_sql_statement_query_s(stmt);
}
{
}
{
return;
}
static const struct sql_field_def *
{
unsigned int i;
return &fields[i];
}
return NULL;
}
static void
{
const char *name;
for (i = 0; i < count; i++) {
case SQL_TYPE_STR:
field_size = sizeof(const char *);
break;
case SQL_TYPE_UINT:
field_size = sizeof(unsigned int);
break;
case SQL_TYPE_ULLONG:
field_size = sizeof(unsigned long long);
break;
case SQL_TYPE_BOOL:
field_size = sizeof(bool);
break;
}
} else {
}
}
}
const struct sql_field_def *fields,
{
}
{
unsigned int i, count;
const char *value;
void *ptr;
for (i = 0; i < count; i++) {
continue;
case SQL_TYPE_STR: {
break;
}
case SQL_TYPE_UINT: {
break;
}
case SQL_TYPE_ULLONG: {
break;
}
case SQL_TYPE_BOOL: {
break;
}
}
}
}
{
int ret;
return ret;
return 1;
}
{
}
static void
{
*dest_result = result;
}
{
/* the callback must have been called */
}
{
}
unsigned int idx)
{
}
{
}
unsigned int idx)
{
}
const unsigned char *
{
}
const char *field_name)
{
}
{
}
{
}
{
return result->error_type;
}
static void
{
}
static int
{
return -1;
}
static const char *
{
return SQL_ERRSTR_NOT_CONNECTED;
}
{
}
{
}
const char **error_r)
{
}
{
}
{
}
struct sql_statement **_stmt)
{
else
}
unsigned int *affected_rows)
{
}
struct sql_statement **_stmt,
unsigned int *affected_rows)
{
else
}
{
return;
}
}
const char *query, unsigned int *affected_rows)
{
else
}
.v = {
NULL,
},
};