DBD-mysql
view release on metacpan or search on metacpan
/*
* DBD::mysql - DBI driver for the MySQL database
*
* Copyright (c) 2005 Patrick Galbraith
* Copyright (c) 2003 Rudolf Lippan
* Copyright (c) 1997-2003 Jochen Wiedmann
*
* Based on DBD::Oracle; DBD::Oracle is
*
* Copyright (c) 1994,1995 Tim Bunce
*
* You may distribute this under the terms of either the GNU General Public
* License or the Artistic License, as specified in the Perl README file.
*/
#define PERL_NO_GET_CONTEXT
/*
* Header files we use
*/
#include <ctype.h>
#include <DBIXS.h> /* installed by the DBI module */
#include <mysql.h> /* Comes with MySQL-devel */
#include <mysqld_error.h> /* Comes MySQL */
#include <errmsg.h> /* Comes with MySQL-devel */
#define true 1
#define false 0
/*
* The following are return codes passed in $h->err in case of
* errors by DBD::mysql.
*/
enum errMsgs {
JW_ERR_CONNECT = 1,
JW_ERR_SELECT_DB,
JW_ERR_STORE_RESULT,
JW_ERR_NOT_ACTIVE,
JW_ERR_QUERY,
JW_ERR_FETCH_ROW,
JW_ERR_LIST_DB,
JW_ERR_CREATE_DB,
JW_ERR_DROP_DB,
JW_ERR_LIST_TABLES,
JW_ERR_LIST_FIELDS,
JW_ERR_LIST_FIELDS_INT,
JW_ERR_LIST_SEL_FIELDS,
JW_ERR_NO_RESULT,
JW_ERR_NOT_IMPLEMENTED,
JW_ERR_ILLEGAL_PARAM_NUM,
JW_ERR_MEM,
JW_ERR_LIST_INDEX,
JW_ERR_SEQUENCE,
AS_ERR_EMBEDDED,
TX_ERR_AUTOCOMMIT,
TX_ERR_COMMIT,
TX_ERR_ROLLBACK,
SL_ERR_NOTAVAILBLE,
};
/*
* Internal constants, used for fetching array attributes
*/
enum av_attribs {
AV_ATTRIB_NAME = 0,
AV_ATTRIB_TABLE,
AV_ATTRIB_TYPE,
AV_ATTRIB_SQL_TYPE,
AV_ATTRIB_IS_PRI_KEY,
AV_ATTRIB_IS_NOT_NULL,
AV_ATTRIB_NULLABLE,
AV_ATTRIB_LENGTH,
AV_ATTRIB_IS_NUM,
AV_ATTRIB_TYPE_NAME,
AV_ATTRIB_PRECISION,
AV_ATTRIB_SCALE,
AV_ATTRIB_MAX_LENGTH,
AV_ATTRIB_IS_KEY,
AV_ATTRIB_IS_BLOB,
AV_ATTRIB_IS_AUTO_INCREMENT,
AV_ATTRIB_LAST /* Dummy attribute, never used, for allocation */
}; /* purposes only */
/*
* This is our part of the driver handle. We receive the handle as
* an "SV*", say "drh", and receive a pointer to the structure below
* by declaring
*
* D_imp_drh(drh);
*
* This declares a variable called "imp_drh" of type
* "struct imp_drh_st *".
*/
struct imp_drh_st {
dbih_drc_t com; /* MUST be first element in structure */
};
/*
* Likewise, this is our part of the database handle, as returned
* by DBI->connect. We receive the handle as an "SV*", say "dbh",
* and receive a pointer to the structure below by declaring
*
* D_imp_dbh(dbh);
*
* This declares a variable called "imp_dbh" of type
* "struct imp_dbh_st *".
*/
struct imp_dbh_st {
dbih_dbc_t com; /* MUST be first element in structure */
( run in 0.831 second using v1.01-cache-2.11-cpan-71847e10f99 )