3 Replies Latest reply on May 4, 2004 1:43 PM by sgwood

    Different Error running nukes-installer

    stiphout

      Ok, so here's my way-fun error. I get through the datasource definition page, then I'm asked which modules I'd like to install. I select all of them, and click next. This is its response:

      Nukes Installer, to my screen, wrote:

      <div style="text-align: center">Error</div>
      • CREATE TABLE nuke_sections ( pn_secid INTEGER NOT NULL IDENTITY, pn_secname VARCHAR(40) DEFAULT '' NOT NULL, pn_image VARCHAR(50) DEFAULT '' NOT NULL ): error Syntax error or access violation, message from server: "You have an error in your SQL syntax near 'IDENTITY, pn_secname VARCHAR(40) DEFAULT '' NOT NULL, pn_image VARCH' at line 4"
      • CREATE TABLE nuke_seccont ( pn_artid INTEGER NOT NULL IDENTITY, pn_secid INTEGER DEFAULT 0, pn_title VARCHAR(256) NOT NULL, pn_content VARCHAR(256) NOT NULL, pn_counter INTEGER DEFAULT 0 NOT NULL, pn_language VARCHAR(30) DEFAULT '' NOT NULL ): error Syntax error or access violation, message from server: "You have an error in your SQL syntax near 'IDENTITY, pn_secid INTEGER DEFAULT 0, pn_title VARCHAR(256) NOT NULL' at line 5"
      • INSERT INTO nuke_sections VALUES (2,'Nukes','transparent.gif'): error General error, message from server: "Table 'aresteia_nukes.nuke_sections' doesn't exist"



      Any ideas?

        • 1. Re: Different Error running nukes-installer
          stiphout

          Ok, managed to fix it myself. For any of you that have this same problem, here's the fix:

          The file nukes-snapshot\sections\src\resources\mysql\setup.xml has some mysql statements that don't seem to be entirely correct. It's my guess that it works on some more forgiving installations/versions/configurations of MySQL, but it didn't on mine, so I had to change it slightly.

          The pertinent statements in that xml file started out as:

          <statement name="sections" description="Creates Sections table">
           [CDATA[
           CREATE TABLE nuke_sections (
           pn_secid INTEGER NOT NULL IDENTITY,
           pn_secname VARCHAR(40) DEFAULT '' NOT NULL,
           pn_image VARCHAR(50) DEFAULT '' NOT NULL
           );
           ]]
          </statement>
          
          <statement name="seccont" description="Creates Sections Contents table">
           [CDATA[
           CREATE TABLE nuke_seccont (
           pn_artid INTEGER NOT NULL IDENTITY,
           pn_secid INTEGER DEFAULT 0,
           pn_title VARCHAR(256) NOT NULL,
           pn_content VARCHAR(256) NOT NULL,
           pn_counter INTEGER DEFAULT 0 NOT NULL,
           pn_language VARCHAR(30) DEFAULT '' NOT NULL
           );
           ]]
          </statement>


          and I changed them to be this:

          <statement name="sections" description="Creates Sections table">
           [CDATA[
           CREATE TABLE nuke_sections (
           pn_secid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
           pn_secname VARCHAR(40) DEFAULT '' NOT NULL,
           pn_image VARCHAR(50) DEFAULT '' NOT NULL
           );
           ]]
          </statement>
          
          <statement name="seccont" description="Creates Sections Contents table">
           [CDATA[
           CREATE TABLE nuke_seccont (
           pn_artid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
           pn_secid INTEGER DEFAULT 0,
           pn_title VARCHAR(255) NOT NULL,
           pn_content VARCHAR(255) NOT NULL,
           pn_counter INTEGER DEFAULT 0 NOT NULL,
           pn_language VARCHAR(30) DEFAULT '' NOT NULL
           );
           ]]
          </statement>


          Essentially, the problem was twofold: 1st, the IDENTITY keyword is not really a MySQL keyword, but some versions of MySQL honor it as a synonym for "AUTO_INCREMENT PRIMARY KEY"

          2nd, VARHCHAR's have a max size of 255, so I chopped off a byte and called it 255 instead of 256. This might cause a bug if the system is validating on 256, so an extra character that was permitted to be typed in might not get saved. Worth looking into for the release, I'd say, but not a big deal for me.

          Anyway, hope this helps!!!


          • 2. Re: Different Error running nukes-installer



            I'll wind these into CVS.


            Sherman

            • 3. Re: Different Error running nukes-installer


              I also made pn_content be a TEXT column.


              Sherman