bug #1523623, BIGINT auto_increment and mysql extension

This commit is contained in:
Marc Delisle
2006-07-17 16:51:51 +00:00
parent a502148316
commit 0254076756
2 changed files with 12 additions and 1 deletions

View File

@@ -6,6 +6,10 @@ $Id$
$Source$
2006-07-17 Marc Delisle <lem9@users.sourceforge.net>
* libraries/dbi/mysql.dbi.lib.php:
bug #1523623, BIGINT auto_increment and mysql extension
2006-07-16 Marc Delisle <lem9@users.sourceforge.net>
* tbl_change.php: Edit next row did not work in 2.9.0-dev

View File

@@ -319,7 +319,14 @@ function PMA_DBI_insert_id($link = null)
return FALSE;
}
}
return mysql_insert_id($link);
//$insert_id = mysql_insert_id($link);
// if the primary key is BIGINT we get an incorrect result
// (sometimes negative, sometimes positive)
// and in the present function we don't know if the PK is BIGINT
// so better play safe and use LAST_INSERT_ID()
//
// by the way, no problem with mysqli_insert_id()
return PMA_DBI_fetch_value('SELECT LAST_INSERT_ID();', 0, 0, $link);
}
function PMA_DBI_affected_rows($link = null)