Msql-Mysql-modules
view release on metacpan or search on metacpan
dbd/dbd.xs.in view on Meta::CPAN
#endif /* defined(DBD_MSQL) && defined(IDX_TYPE) && defined(HAVE_STRPTIME) */
MODULE = DBD::~~dbd_driver~~ PACKAGE = DBD::~~dbd_driver~~::dr
void
_ListDBs(drh, host, port=NULL)
SV * drh
char * host
char * port
PPCODE:
{
#if defined(DBD_MYSQL)
MYSQL mysql;
dbh_t sock = &mysql;
#elif defined(DBD_MSQL)
dbh_t sock;
#endif
if (MyConnect(&sock,NULL,host,port,NULL,NULL,NULL,NULL)) {
result_t res;
row_t cur;
dbd/dbd.xs.in view on Meta::CPAN
void
_admin_internal(drh,dbh,command,dbname=NULL,host=NULL,port=NULL,user=NULL,password=NULL)
SV* drh
SV* dbh
char* command
char* dbname
char* host
char* port
char* user
char* password
PPCODE:
{
dbh_t sock;
int result;
#if defined(DBD_MYSQL)
MYSQL mysql;
sock = &mysql;
#endif
/*
* Connect to the database, if required.
dbd/dbd.xs.in view on Meta::CPAN
if (result) { XSRETURN_YES; } else { XSRETURN_NO; }
}
MODULE = DBD::~~dbd_driver~~ PACKAGE = DBD::~~dbd_driver~~::db
void
type_info_all(dbh)
SV* dbh
PPCODE:
{
/* static AV* types = NULL; */
/* if (!types) { */
/* D_imp_dbh(dbh); */
/* if (!(types = dbd_db_type_info_all(dbh, imp_dbh))) { */
/* croak("Cannot create types array (out of memory?)"); */
/* } */
/* } */
/* ST(0) = sv_2mortal(newRV_inc((SV*) types)); */
D_imp_dbh(dbh);
dbd/dbd.xs.in view on Meta::CPAN
warn("This method is deprecated. Use $dbh->{'mysql_insertid'}.");
}
sprintf(buf, "%lu", mysql_insert_id(sock));
ST(0) = sv_2mortal(newSVpv(buf, strlen(buf)));
#endif
void
_ListDBs(dbh)
SV* dbh
PPCODE:
D_imp_dbh(dbh);
result_t res;
row_t cur;
res = MyListDbs(imp_dbh->svsock);
if (!res && (!MyReconnect(imp_dbh->svsock, dbh)
|| !(res = MyListDbs(imp_dbh->svsock)))) {
do_error(dbh, MyErrno(imp_dbh->svsock, JW_ERR_LIST_DB),
MyError(imp_dbh->svsock));
} else {
EXTEND(sp, MyNumRows(res));
while ((cur = MyFetchRow(res))) {
PUSHs(sv_2mortal((SV*)newSVpv(cur[0], strlen(cur[0]))));
}
MyFreeResult(res);
}
void
_ListTables(dbh)
SV * dbh
PPCODE:
D_imp_dbh(dbh);
result_t res;
row_t cur;
res = MyListTables(imp_dbh->svsock);
if (!res && (!MyReconnect(imp_dbh->svsock, dbh)
|| !(res = MyListTables(imp_dbh->svsock)))) {
do_error(dbh, MyErrno(imp_dbh->svsock, JW_ERR_LIST_TABLES),
MyError(imp_dbh->svsock));
} else {
while ((cur = MyFetchRow(res))) {
dbd/dbd.xs.in view on Meta::CPAN
RETVAL
void
quote(dbh, str, type=NULL)
SV* dbh
SV* str
SV* type
PROTOTYPE: $$;$
PPCODE:
{
SV* quoted = dbd_db_quote(dbh, str, type);
ST(0) = quoted ? sv_2mortal(quoted) : str;
XSRETURN(1);
}
#if defined(DBD_MSQL) && defined(IDX_TYPE)
void
getsequenceinfo(dbh, table)
SV* dbh
char* table
PROTOTYPE: $$
PPCODE:
{
m_seq* seq;
D_imp_dbh(dbh);
seq = msqlGetSequenceInfo(imp_dbh->svsock, table);
if (!seq) {
do_error(dbh, MyErrno(sock, JW_ERR_SEQUENCE), MyError(sock));
XSRETURN_UNDEF;
} else {
EXTEND(sp, 2);
ST(0) = sv_2mortal(newSViv(seq->step));
( run in 0.831 second using v1.01-cache-2.11-cpan-5511b514fd6 )