Fri, 29 Jun 2012 17:45:37 +0100
MySQL: Avoid allocating the full column size to receive results, for variable-length types check result size before allocation (thanks Florob)
33 | 1 | #ifdef _MSC_VER /* all MS compilers define this (version) */ |
2 | #include <windows.h> | |
3 | #endif | |
4 | ||
5 | ||
1 | 6 | #include <mysql.h> |
7 | #include <dbd/common.h> | |
8 | ||
9 | #define DBD_MYSQL_CONNECTION "DBD.MySQL.Connection" | |
10 | #define DBD_MYSQL_STATEMENT "DBD.MySQL.Statement" | |
11 | ||
2 | 12 | /* |
13 | * connection object implementation | |
14 | */ | |
1 | 15 | typedef struct _connection { |
16 | MYSQL *mysql; | |
17 | } connection_t; | |
18 | ||
2 | 19 | /* |
20 | * statement object implementation | |
21 | */ | |
1 | 22 | typedef struct _statement { |
23 | MYSQL *mysql; | |
24 | MYSQL_STMT *stmt; | |
2 | 25 | MYSQL_RES *metadata; /* result dataset metadata */ |
1 | 26 | } statement_t; |
27 |