]> granicus.if.org Git - php/commitdiff
let it compile again
authorWez Furlong <wez@php.net>
Wed, 19 Jan 2005 00:33:56 +0000 (00:33 +0000)
committerWez Furlong <wez@php.net>
Wed, 19 Jan 2005 00:33:56 +0000 (00:33 +0000)
ext/pdo_firebird/firebird_driver.c
ext/pdo_firebird/firebird_statement.c

index 3dce6aea84b6c2278a99339c9887c4c897048d3a..27335affb57018ab8f0897893308642a65b4cc9b 100644 (file)
@@ -386,7 +386,7 @@ static int firebird_alloc_prepare_stmt(pdo_dbh_t *dbh, const char *sql, long sql
                
        /* Firebird allows SQL statements up to 64k, so bail if it doesn't fit */
        if (sql_len > SHORT_MAX) {
-               dbh->error_code = PDO_ERR_TRUNCATED;
+               strcpy(dbh->error_code, "01004");
                return 0;
        }
        
index 3907d92634cdbd8afe20786c52160c6eff47821d..98e8959f920839d52126c7baa07b4efcf055ec7f 100644 (file)
@@ -132,7 +132,7 @@ static int firebird_stmt_fetch(pdo_stmt_t *stmt, /* {{{ */
        pdo_firebird_db_handle *H = S->H;
 
        if (!stmt->executed) {
-               stmt->error_code = PDO_ERR_CANT_MAP;
+               strcpy(stmt->error_code, "HY000");
                H->last_app_error = "Cannot fetch from a closed cursor";
        } else if (!S->exhausted) {
 
@@ -482,7 +482,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
        }
 
        if (!sqlda || param->paramno >= sqlda->sqld) {
-               stmt->error_code = PDO_ERR_NOT_FOUND;
+               strcpy(stmt->error_code, "HY093");
                S->H->last_app_error = "Invalid parameter index";
                return 0;
        }
@@ -508,7 +508,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
                                }
                        }
                        if (i >= sqlda->sqld) {
-                               stmt->error_code = PDO_ERR_NOT_FOUND;
+                               strcpy(stmt->error_code, "HY093");
                                S->H->last_app_error = "Invalid parameter name";
                                return 0;
                        }
@@ -538,7 +538,7 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
 
                        switch (var->sqltype & ~1) {
                                case SQL_ARRAY:
-                                       stmt->error_code = PDO_ERR_NOT_IMPLEMENTED;
+                                       strcpy(stmt->error_code, "HY000");
                                        S->H->last_app_error = "Cannot bind to array field";
                                        return 0;
        
@@ -585,14 +585,14 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
                                case IS_NULL:
                                        /* complain if this field doesn't allow NULL values */
                                        if (~var->sqltype & 1) {
-                                               stmt->error_code = PDO_ERR_CONSTRAINT;
+                                               strcpy(stmt->error_code, "HY105");
                                                S->H->last_app_error = "Parameter requires non-null value";
                                                return 0;
                                        }
                                        *var->sqlind = -1;
                                        break;
                                default:
-                                       stmt->error_code = PDO_ERR_NOT_IMPLEMENTED;
+                                       strcpy(stmt->error_code, "HY105");
                                        S->H->last_app_error = "Binding arrays/objects is not supported";
                                        return 0;
                        }