#6 AUTO_INCREMENT row shouldn't have DEFAULT value

v0.1.13
closed-fixed
SQL (14)
8
2005-05-21
2005-04-23
No

ERROR:
Invalid default value for 'mod_id'

SUMMARY:
AUTO_INCREMENT and DEFAULT should not be in the same
SQL query.

LINKS:
http://area51.phpbb.com/phpBB/viewtopic.php?p=106232#106232

FIX:
http://area51.phpbb.com/phpBB/viewtopic.php?p=106247#106247,
http://area51.phpbb.com/phpBB/viewtopic.php?t=19158

Discussion

  • Gordon P. Hemsley

    • priority: 5 --> 8
     
  • Gordon P. Hemsley

    • assigned_to: nobody --> bkettle
    • status: open --> closed-fixed
     
  • Gordon P. Hemsley

    Logged In: YES
    user_id=779036

    The fix was committed to CVS earlier today.

     
  • Brendan Kettle

    Brendan Kettle - 2005-04-27

    Logged In: YES
    user_id=1246790

    I'll keep this open, as the generated sql from installing
    MODs that use AUTO_INCREMENT also adds DEFAULT and creates
    errors.

     
  • Brendan Kettle

    Brendan Kettle - 2005-04-27
    • status: closed-fixed --> open-fixed
     
  • Gordon P. Hemsley

    • labels: --> SQL
     
  • Gordon P. Hemsley

    Logged In: YES
    user_id=779036

    This patch should fix the remaining conflict between
    AUTO_INCREMENT and DEFAULT when processing SQL queries from
    MODs.

     
  • Brendan Kettle

    Brendan Kettle - 2005-05-04

    Logged In: YES
    user_id=1246790

    The patch provided seems to disrecard the auto increment,
    I'll have to look into more when I get time.

     
  • Gordon P. Hemsley

    Logged In: YES
    user_id=779036

    I don't think I disregarded AUTO_INCREMENT in the patch, but
    I can't say for sure.

     
  • Eric Faerber

    Eric Faerber - 2005-05-14

    Logged In: YES
    user_id=657440

    That patch is only for MSSQL. Look at the lines around 433
    in em_schema.php. You might be able to do something like

        'default' => \( empty\($increment\) \) ? $default : '',
        'def\_val' => \( empty\($increment\) \) ? $default\_value : '',
        'increment' => $increment,
    
     
  • Gordon P. Hemsley

    Logged In: YES
    user_id=779036

    Eric: The patch is "only" for MSSQL because the other DBMSs
    don't need any changes. Besides the fact that the second
    edit should take care over everyone at once. Your suggested
    edit is not a bad idea, especially in conjunction with the
    two in my patch.

    Brendan: As for disregarding AUTO_INCREMENT, I believe all
    the patch does is move DEFAULT out of the way if an
    AUTO_INCREMENT is present. Maybe I'm not understanding what
    you mean by "disregarding"?

     
  • Brendan Kettle

    Brendan Kettle - 2005-05-20
    • status: open-fixed --> closed-fixed
     
  • Brendan Kettle

    Brendan Kettle - 2005-05-20

    Logged In: YES
    user_id=1246790

    Ok, should be all fixed.

     
  • Gordon P. Hemsley

    • milestone: --> v0.1.13
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks