Changeset 6b7e8e7 in github


Ignore:
Timestamp:
Aug 4, 2009 4:22:41 AM (4 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
30341c4
Parents:
dbfceb4
Message:
  • Use sequence names only with PostgreSQL (#1486018)
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    rf058348 r6b7e8e7  
    22=========================== 
    33 
     4- Use sequence names only with PostgreSQL (#1486018) 
    45- Re-designed User Preferences interface  
    56- Fix MS SQL DDL (#1486020) 
  • program/include/rcube_contacts.php

    r4307ccd8 r6b7e8e7  
    272272        ); 
    273273         
    274       $insert_id = $this->db->insert_id(get_sequence_name('contacts')); 
     274      $insert_id = $this->db->insert_id('contacts'); 
    275275    } 
    276276 
  • program/include/rcube_mdb2.php

    rdec9e85 r6b7e8e7  
    322322   * For Postgres databases, a sequence name is required 
    323323   * 
    324    * @param  string  Sequence name for increment 
     324   * @param  string  Table name (to find the incremented sequence) 
    325325   * @return mixed   ID or FALSE on failure 
    326326   * @access public 
    327327   */ 
    328   function insert_id($sequence = '') 
     328  function insert_id($table = '') 
    329329    { 
    330330    if (!$this->db_handle || $this->db_mode=='r') 
    331331      return FALSE; 
    332332 
    333     $id = $this->db_handle->lastInsertID($sequence); 
     333    // find sequence name 
     334    if ($table && $this->db_provider == 'pgsql') 
     335      $table = get_sequence_name($table); 
     336 
     337    $id = $this->db_handle->lastInsertID($table); 
    334338     
    335339    return $this->db_handle->isError($id) ? null : $id; 
  • program/include/rcube_user.php

    rfccdf16 r6b7e8e7  
    232232                        array_merge(array($sql), $insert_values)); 
    233233 
    234     return $this->db->insert_id(get_sequence_name('identities')); 
     234    return $this->db->insert_id('identities'); 
    235235  } 
    236236   
     
    387387      $_SESSION['language']); 
    388388 
    389     if ($user_id = $dbh->insert_id(get_sequence_name('users'))) 
     389    if ($user_id = $dbh->insert_id('users')) 
    390390    { 
    391391      // create rcube_user instance to make plugin hooks work 
Note: See TracChangeset for help on using the changeset viewer.