Skip to content

Commit

Permalink
Merge pull request #1028 from dreamsxin/bug_1022_1.3.0
Browse files Browse the repository at this point in the history
Fix BUG #1022 1.3.0
  • Loading branch information
Phalcon committed Aug 8, 2013
2 parents 98c6e0c + 4e54cac commit 9a688b3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions ext/mvc/model.c
Original file line number Diff line number Diff line change
Expand Up @@ -3094,7 +3094,7 @@ PHP_METHOD(Phalcon_Mvc_Model, _doLowInsert){
zval *attribute_field = NULL, *exception_message = NULL;
zval *value = NULL, *bind_type = NULL, *default_value, *use_explicit_identity;
zval *success, *sequence_name = NULL, *support_sequences;
zval *source, *last_insert_id;
zval *schema, *source, *last_insert_id;
HashTable *ah0;
HashPosition hp0;
zval **hd;
Expand Down Expand Up @@ -3294,11 +3294,19 @@ PHP_METHOD(Phalcon_Mvc_Model, _doLowInsert){
if (phalcon_method_exists_ex(this_ptr, SS("getsequencename") TSRMLS_CC) == SUCCESS) {
phalcon_call_method(sequence_name, this_ptr, "getsequencename");
} else {
PHALCON_INIT_VAR(schema);
phalcon_call_method(schema, this_ptr, "getschema");

PHALCON_INIT_VAR(source);
phalcon_call_method(source, this_ptr, "getsource");

PHALCON_INIT_NVAR(sequence_name);
PHALCON_CONCAT_VSVS(sequence_name, source, "_", identity_field, "_seq");

if (PHALCON_IS_EMPTY(schema)) {
PHALCON_INIT_NVAR(sequence_name);
PHALCON_CONCAT_VSVS(sequence_name, source, "_", identity_field, "_seq");
} else {
PHALCON_INIT_NVAR(sequence_name);
PHALCON_CONCAT_VSVSVS(sequence_name, schema, ".", source, "_", identity_field, "_seq");
}
}
}

Expand Down

0 comments on commit 9a688b3

Please sign in to comment.