#endif
,{"10.0",DBVERSION_100}
,{"auto",0} /* Only works with FreeTDS. Other drivers will bork */
-
+
};
-
- nvers = sizeof(tdsver)/sizeof(tdsver[0]);
-
+
struct pdo_data_src_parser vars[] = {
{ "charset", NULL, 0 }
,{ "appname", "PHP " PDO_DBLIB_FLAVOUR, 0 }
,{ "secure", NULL, 0 } /* DBSETLSECURE */
,{ "version", NULL, 0 } /* DBSETLVERSION */
};
-
+
nvars = sizeof(vars)/sizeof(vars[0]);
-
+ nvers = sizeof(tdsver)/sizeof(tdsver[0]);
+
php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, nvars);
+ if (driver_options) {
+ int timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30);
+ dbsetlogintime(timeout); /* Connection/Login Timeout */
+ dbsettime(timeout); /* Statement Timeout */
+ }
+
H = pecalloc(1, sizeof(*H), dbh->is_persistent);
H->login = dblogin();
H->err.sqlstate = dbh->error_code;
/* Cancel any pending results */
dbcancel(H->link);
- efree(stmt->columns[i].name);
+
+ if (stmt->columns) {
+ int i = 0;
+ for (; i < stmt->column_count; i++) {
+ if (stmt->columns[i].name) {
++ zend_string_release(stmt->columns[i].name);
+ }
+ }
+ efree(stmt->columns);
+ stmt->columns = NULL;
+ }
return 1;
}
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
- efree(stmt->columns[i].name);
+ if (stmt->columns) {
+ int i = 0;
+ for (; i < stmt->column_count; i++) {
+ if (stmt->columns[i].name) {
++ zend_string_release(stmt->columns[i].name);
+ }
+ }
+ efree(stmt->columns);
+ stmt->columns = NULL;
+ }
+
efree(S);
-
+
return 1;
}