Header

  1. View current page

    DoNT - Do Not Think!!!

Profile_img_172x172_08
DoNT - Do Not Think!!!
10

MySQL INSERT ... ON DUPLICATE KEY UPDATE ... LAST_INSERT_ID 0 반환하는 문제

MySQL INSERT ... ON DUPLICATE KEY UPDATE ... LAST_INSERT_ID 0 반환하는 문제

MySQL Bugs

http://bugs.mysql.com/bug.php?id=24432

http://bugs.mysql.com/bug.php?id=27033

 

ubuntu 7.04 + mysql 5.0.38 에서 INSERT ... ON DUPLICATE KEY UPDATE ... LAST_INSERT_ID 쿼리 사용 시 반환값이 id가 아니라 0이 넘어오는 문제

  1. mysql> INSERT rss (url, description) VALUES ('http://dont.pe.kr/tt/rss', '') ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id); SELECT @id := LAST_INSERT_ID();
  2. Query OK, 0 rows affected (0.00 sec)

  3. +-------------------------+
    | @id := LAST_INSERT_ID() |
    +-------------------------+
    |                       1 |
    +-------------------------+
    1 row in set (0.00 sec)

 

mysql 버전 업그레이드로 해결

ubuntu 7.10 + mysql 5.0.45 업그레이드

 

Tags

History

Last edited on 01/10/2008 10:36 by duddns

Comments (0)

You must log in to leave a comment. Please sign in.