فهرست منبع

Fixed CURRVAL to have brackets around sequence name. There were incorrectly around just the table name

spficklin 12 سال پیش
والد
کامیت
d401d30a64
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      tripal_core/api/tripal_core_chado.api.inc

+ 2 - 2
tripal_core/api/tripal_core_chado.api.inc

@@ -347,7 +347,7 @@ function tripal_core_chado_insert($table, $values, $options = array()) {
     if (array_key_exists('primary key', $table_desc) and is_array($table_desc['primary key'])) {
       foreach ($table_desc['primary key'] as $field) {
         $sql = '';
-        $psql = "PREPARE currval_" . $table . "_" . $field . " AS SELECT CURRVAL('{" . $table . "}_" . $field . "_seq')";
+        $psql = "PREPARE currval_" . $table . "_" . $field . " AS SELECT CURRVAL('{" . $table . "_" . $field . "_seq}')";
         $is_prepared = tripal_core_chado_prepare("currval_" . $table . "_" . $field, $psql, array());
         $value = '';
         if ($is_prepared) {
@@ -359,7 +359,7 @@ function tripal_core_chado_insert($table, $values, $options = array()) {
           }
         }
         else {
-          $sql = "SELECT CURRVAL('{" . $table . "}_" . $field . "_seq')";
+          $sql = "SELECT CURRVAL('{" . $table . "_" . $field . "_seq}')";
           $value =  db_result(chado_query($sql));
           if (!$value) {
             watchdog('tripal_core', "tripal_core_chado_insert: not able to retrieve primary key after insert: %sql",