now can in right way reply to empty resultsets

This commit is contained in:
Max Lapshin
2009-10-14 01:57:04 +04:00
parent be08fe62f3
commit de53ecd1c0
2 changed files with 146 additions and 81 deletions

View File

@@ -18,19 +18,30 @@
#define KEY_SIZE 20
// Define struct to hold state across calls
typedef struct _bdb_drv_t {
typedef struct sqlite3_drv_t {
ErlDrvPort port;
unsigned int key;
struct sqlite3 *db;
} sqlite3_drv_t;
typedef struct async_sqlite3_command {
sqlite3_drv_t *driver_data;
sqlite3_stmt *statement;
ErlDrvTermData *dataset;
int term_count;
int row_count;
double *floats;
int binaries_count;
ErlDrvBinary **binaries;
} async_sqlite3_command;
static ErlDrvData start(ErlDrvPort port, char* cmd);
static void stop(ErlDrvData handle);
static int control(ErlDrvData drv_data, unsigned int command, char *buf,
int len, char **rbuf, int rlen);
static void ready_async(ErlDrvData drv_data, ErlDrvThreadData thread_data);
static int sql_exec(sqlite3_drv_t *drv, char *buf, int len);
// static void get(bdb_drv_t *bdb_drv, ErlIOVec *ev);
// static void del(bdb_drv_t *bdb_drv, ErlIOVec *ev);
static void sql_exec_async(void *async_command);
static void sql_free_async(void *async_command);
static void ready_async(ErlDrvData drv_data, ErlDrvThreadData thread_data);
static int unknown(sqlite3_drv_t *bdb_drv, char *buf, int len);