Fixed use of undefined variable in method exec_INSERTquery() with MySQL handler
authorXavier Perseguers <typo3@perseguers.ch>
Wed, 1 Dec 2010 10:39:23 +0000 (10:39 +0000)
committerXavier Perseguers <typo3@perseguers.ch>
Wed, 1 Dec 2010 10:39:23 +0000 (10:39 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/trunk@40709 735d13b6-9817-0410-8766-e36946ffe9aa

typo3/sysext/dbal/ChangeLog
typo3/sysext/dbal/class.ux_t3lib_db.php

index 9c8ddc5..cf80955 100644 (file)
@@ -4,6 +4,7 @@
 
 2010-12-01  Xavier Perseguers  <typo3@perseguers.ch>
 
+       * Fixed use of undefined variable $where in method exec_INSERTquery() with MySQL handler
        * Fixed use of undefined variable $mapping in method map_subquery()
        * Follow-up for bug #16392: Native tables could not be retrieved anymore
        * Code cleanup
index 4cac7c2..85f43e7 100644 (file)
@@ -458,6 +458,8 @@ class ux_t3lib_DB extends t3lib_DB {
                                        $sqlResult = mysql_query($this->lastQuery, $this->handlerInstance[$this->lastHandlerKey]['link']);
                                } else {
                                        $sqlResult = mysql_query($this->lastQuery[0], $this->handlerInstance[$this->lastHandlerKey]['link']);
+                                       $new_id = $this->sql_insert_id();
+                                       $where = $this->cache_autoIncFields[$table] . '=' . $new_id;
                                        foreach ($this->lastQuery[1] as $field => $content) {
                                                mysql_query('UPDATE ' . $this->quoteFromTables($table) . ' SET ' . $this->quoteFromTables($field) . '=' . $this->fullQuoteStr($content, $table) . ' WHERE ' . $this->quoteWhereClause($where), $this->handlerInstance[$this->lastHandlerKey]['link']);
                                        }