Main Stories
Slash Boxes

Slash Open Source Project

Slashcode Log In

Log In

[ Create a new account ]

SQL 3.23.25-beta Issues?

posted by Krow on 12:56 PM October 30th, 2000   Printer-friendly   Email story
iomud writes "It seems I'm having a UID creation issue which shows up as this error:

DBD::mysql::st fetchrow failed: at ..//Slash.pm line 1019.
DBD::mysql::db do failed: Duplicate entry '2147483647' for key 1 at ..//Slash.pm line 1159.

Basically once one user is created no other users are able to be created automatically, the uid's all come up as duplicates ('2147483647') . Upon doing some homework I'd wager to guess it has something to do with mysql version 3.23.25-beta and the -1 that Anonymous Coward has as a UID. I hear is no longer legal with primary key in this version of mysql, Anyone care to comment? post a patch perhaps? I also attempted to update Anonymous Cowards UID to 0 this created a TZ sql error at the top of the page I'll assume all fields with pkey and a -1 value have to be incremented to something other than -1. Any thoughts? Maybe I've got this all wrong if so please feel free to correct me."

I am told that there is a way to solve this by calling CREATE TABLE with a table type. I've not tired it myself, or seen the syntax, but a lot of people would be grateful if someone dug up how to do this.

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login
Loading... please wait.
  • I'd use bender if it were in a stable development phase to my knowledge it's still not 100% functional and stable if you know something I dont please let me know as I'm itching to try it (bender)
  • My issue did have to deal with what i explained in my post -1 and auto increment dont get along in the development versions of mysql 3.23.x
  • I basically installed a slash compatible mysql :) . More specifically the problem was related to auto-increment, anyhow I'm sure this will be resolved for bender in one form or another.
  • [Mon Oct 30 20:39:09 2000] [error] /users.pl:INSERT INTO users_comments (uid) V ALUES( '4294967296')
    DBD::mysql::db do failed: Duplicate entry '2147483647' for key 1 at ..//Slash.pm line 1160.

    I modified the Slash.pm to do a apachelog of the sql query first. It complained for me for every attempted query regardless. I figured that I would check the database, see if I had corrupted it somehow. However, myisamchk reported back error 22 for every file.
    I upgraded to mysql 3.23.27. myisamchk works great now, but slashd won't start now.

    It now fails with this:

    Unknown error Compilation failed in require at ./slashd line 637.
    why am I here? at ./slashd line 39
    main::END() called at ./slashd line 0
    require 0 called at ./slashd line 0

    Line 637 is "require Slash;", anyways, still scratching my head.
  • I test bender with version 3.23 and perl 5.6. Not a singe problem with it.
    --

    --
    You can't grep a dead tree.
  • My mistake... Sorry. Your very right.

    ---
    drop database autoinctest;
    create database autoinctest;
    use autoinctest;
    create table test (
        num int(11) NOT NULL auto_increment,
        text varchar(20) DEFAULT '' NOT NULL,
        PRIMARY KEY (num)
    );
    insert into test VALUES(0,"first");
    insert into test VALUES(0,"second");
    insert into test VALUES(-1,"negative one");
    insert into test VALUES(0,"third");
    insert into test VALUES(0,"fourth");

    ---
    The above SQL produces the wonderful "ERROR 1062: Duplicate entry '2147483647' for key 1"

    The table looks like this:

    +------------+--------------+
    | num | text |
    +------------+--------------+
    | 1 | first |
    | 2 | second |
    | -1 | negative one |
    | 2147483647 | third |
    +------------+--------------+

    Anyways, I also tried it on a database running 3.22 and it works fine (ie, third is 3 and fourth is 4 and there is no 2147483647 for num)

    This seems to me to be a bug in MySQL. I haven't finished reading through the MySQL mailing lists to check on the status. Has anyone else submitted this found something, or submitted something?