What should I change to avoid Aurora MySQL Error 1034 when executing this INSERT statement?











up vote
0
down vote

favorite












I consistently get this error (Error Code: 1034. Incorrect key file for table '/rdsdbdata/tmp/#sql_1709_0'; try to repair it) in Amazon Web Services (AWS) Aurora MySQL 5.7 when I run the following INSERT statement (or run the SELECT clause in the INSERT statement as a separate SELECT statement).



What do I need to change about the INSERT statement (or the AWS Aurora MySQL 5.7 instance or other AWS ecosystem components) so that I don't get this error? (I'm not primarily interested in how to repair the temp table that is referenced in the error message - I want to avoid getting the error in the first place, since this INSERT statement will run as part of a larger script).



The INSERT statement is as follows:



INSERT INTO GEO_AREA ( Geo_Area_Nm,     Geo_Area_Abrv,      Geo_Area_Full_Qualfd_Nm,    Geo_Area_Full_Qualfd_Abrv,      
Geo_Area_Typ_CK, Geo_Area_Prim_ID, Last_Modfd_By_ID, Crtd_By_ID
)
SELECT
Concat("Precinct ", S.PrecinctNumber) AS Geo_Area_Nm, -- The plain Precinct identifier, preceded by the word "Precinct",
-- without any county or state information added.
S.PrecinctNumber AS Geo_Area_Abrv, -- The plain Precinct identifier without any county or state information added.
Concat(S.Jurisname, ", ", STATE.Geo_Area_Nm," - Precinct: ",
S.PrecinctNumber) AS Geo_Area_Full_Qualfd_Nm, -- [Elector Jurisdiction name, State Name:] Precinct: [Precinct ID]
Concat(S.Jurisname, ", ", STATE.Geo_Area_Abrv," - Prcnct: ",
S.PrecinctNumber) AS Geo_Area_Full_Qualfd_Nm, -- [Elector Jurisdiction name, State Name:] Precinct: [Precinct ID]
@Prcnct_CK AS Geo_Area_Typ_CK, -- => Precinct
Concat("US-", S.State, "-",S.Juriscode, "-Prcnct:", S.PrecinctNumber) AS Geo_Area_Prim_ID,
-- Example: US-WY-5602100000-Prcnct:3 08
Max(Concat("DTVF-", S.SourceID)) As Last_Modfd_By_ID,
Max(Concat("DTVF-", S.SourceID)) As Crtd_By_ID
FROM VW_STG_DATA_TRUST_VOTR_INSERT S
LEFT JOIN GEO_AREA STATE -- STATE is the source of the State name and abbreviation that was loaded in Initial LOAD
ON Concat('US-',S.State) = STATE.Geo_Area_Prim_ID
LEFT JOIN GEO_AREA EXIST_GA -- EXIST_GA is the set of records in GEO_AREA before this insert
ON Concat("US-", S.State, "-",S.Juriscode, "-Prcnct:", S.PrecinctNumber) = EXIST_GA.Geo_Area_Prim_ID
WHERE STATE.Geo_Area_Typ_CK = @State_CK -- => Connection for US State level info
-- AND Concat(S.JurisName, ", ", STATE.Geo_Area_Nm) = 'Abbotsford City, Wisconsin'
AND EXIST_GA.Geo_Area_Prim_ID IS NULL
GROUP BY 1,2,3,4,5,6
;


I have taken the following steps to try to correct the problem, none of which have worked:



⦁ Dropping and recreating the target table (GEO_AREA) in the same AWS Aurora MySQL database instance.



⦁ Stopping and restarting the RDS instance.



⦁ Creating a new AWS Aurora MySQL 5.7 database instance (wpai-archimedes-dev-dbi) and creating and loading within it a fairly small set of tables and views (including those that are needed to support this INSERT statement). Therefore, I don't think that it is a disk space problem.



Background:



⦁ This INSERT statement (and the SELECT statement within it) draw data from a large staging table/view that contains one row per person/voter and attempts to load one row per [Electoral] Precinct into the Geographic Area (GEO_AREA) table. There can be many rows in the staging table/view that contain voters in a single Electoral Precinct.



⦁ I have two similarly structured INSERT statements that load one row per County and and Electoral Jurisdiction into the GEO_AREA table. These two insert statements work properly (without errors). An example of the insert statement that correctly loads counties is at the bottom of this case description.



⦁ After receiving this error, I can still run other SQL queries against the GEO_AREA table without getting an error, e.g.,



SELECT * FROM GEO_AREA WHERE Geo_Area_Typ_CK in (252, 255) order by 6 desc, 4;


⦁ Rows for Country and State/Province level geographic areas are loaded into GEO_AREA from a .csv file on my laptop with a LOAD DATA LOCAL INFILE command.



⦁ I've tried this INSERT statement in two separate Aurora MySQL database instances. The instance type in both cases is db.r4.xlarge. The first DB instance (the instance referenced in this tech support case) was loaded from a 1.002 GB .csv file (a 1M record random sample of voters from all 50 states in the US), which currently uses 1.334GB of storage space in all tables, and shows (in the results from the snapshot taken this morning) that the instance uses 1 GB of storage space. The second instance was loaded from a 4.623GB csv file (4M records describing all voters in the state of Tennessee), which currently uses 3.727 GB of storage space in all tables, and shows (again, in the results from the snapshot taken this morning) that the instance uses 7 GB of storage space.










share|improve this question


























    up vote
    0
    down vote

    favorite












    I consistently get this error (Error Code: 1034. Incorrect key file for table '/rdsdbdata/tmp/#sql_1709_0'; try to repair it) in Amazon Web Services (AWS) Aurora MySQL 5.7 when I run the following INSERT statement (or run the SELECT clause in the INSERT statement as a separate SELECT statement).



    What do I need to change about the INSERT statement (or the AWS Aurora MySQL 5.7 instance or other AWS ecosystem components) so that I don't get this error? (I'm not primarily interested in how to repair the temp table that is referenced in the error message - I want to avoid getting the error in the first place, since this INSERT statement will run as part of a larger script).



    The INSERT statement is as follows:



    INSERT INTO GEO_AREA ( Geo_Area_Nm,     Geo_Area_Abrv,      Geo_Area_Full_Qualfd_Nm,    Geo_Area_Full_Qualfd_Abrv,      
    Geo_Area_Typ_CK, Geo_Area_Prim_ID, Last_Modfd_By_ID, Crtd_By_ID
    )
    SELECT
    Concat("Precinct ", S.PrecinctNumber) AS Geo_Area_Nm, -- The plain Precinct identifier, preceded by the word "Precinct",
    -- without any county or state information added.
    S.PrecinctNumber AS Geo_Area_Abrv, -- The plain Precinct identifier without any county or state information added.
    Concat(S.Jurisname, ", ", STATE.Geo_Area_Nm," - Precinct: ",
    S.PrecinctNumber) AS Geo_Area_Full_Qualfd_Nm, -- [Elector Jurisdiction name, State Name:] Precinct: [Precinct ID]
    Concat(S.Jurisname, ", ", STATE.Geo_Area_Abrv," - Prcnct: ",
    S.PrecinctNumber) AS Geo_Area_Full_Qualfd_Nm, -- [Elector Jurisdiction name, State Name:] Precinct: [Precinct ID]
    @Prcnct_CK AS Geo_Area_Typ_CK, -- => Precinct
    Concat("US-", S.State, "-",S.Juriscode, "-Prcnct:", S.PrecinctNumber) AS Geo_Area_Prim_ID,
    -- Example: US-WY-5602100000-Prcnct:3 08
    Max(Concat("DTVF-", S.SourceID)) As Last_Modfd_By_ID,
    Max(Concat("DTVF-", S.SourceID)) As Crtd_By_ID
    FROM VW_STG_DATA_TRUST_VOTR_INSERT S
    LEFT JOIN GEO_AREA STATE -- STATE is the source of the State name and abbreviation that was loaded in Initial LOAD
    ON Concat('US-',S.State) = STATE.Geo_Area_Prim_ID
    LEFT JOIN GEO_AREA EXIST_GA -- EXIST_GA is the set of records in GEO_AREA before this insert
    ON Concat("US-", S.State, "-",S.Juriscode, "-Prcnct:", S.PrecinctNumber) = EXIST_GA.Geo_Area_Prim_ID
    WHERE STATE.Geo_Area_Typ_CK = @State_CK -- => Connection for US State level info
    -- AND Concat(S.JurisName, ", ", STATE.Geo_Area_Nm) = 'Abbotsford City, Wisconsin'
    AND EXIST_GA.Geo_Area_Prim_ID IS NULL
    GROUP BY 1,2,3,4,5,6
    ;


    I have taken the following steps to try to correct the problem, none of which have worked:



    ⦁ Dropping and recreating the target table (GEO_AREA) in the same AWS Aurora MySQL database instance.



    ⦁ Stopping and restarting the RDS instance.



    ⦁ Creating a new AWS Aurora MySQL 5.7 database instance (wpai-archimedes-dev-dbi) and creating and loading within it a fairly small set of tables and views (including those that are needed to support this INSERT statement). Therefore, I don't think that it is a disk space problem.



    Background:



    ⦁ This INSERT statement (and the SELECT statement within it) draw data from a large staging table/view that contains one row per person/voter and attempts to load one row per [Electoral] Precinct into the Geographic Area (GEO_AREA) table. There can be many rows in the staging table/view that contain voters in a single Electoral Precinct.



    ⦁ I have two similarly structured INSERT statements that load one row per County and and Electoral Jurisdiction into the GEO_AREA table. These two insert statements work properly (without errors). An example of the insert statement that correctly loads counties is at the bottom of this case description.



    ⦁ After receiving this error, I can still run other SQL queries against the GEO_AREA table without getting an error, e.g.,



    SELECT * FROM GEO_AREA WHERE Geo_Area_Typ_CK in (252, 255) order by 6 desc, 4;


    ⦁ Rows for Country and State/Province level geographic areas are loaded into GEO_AREA from a .csv file on my laptop with a LOAD DATA LOCAL INFILE command.



    ⦁ I've tried this INSERT statement in two separate Aurora MySQL database instances. The instance type in both cases is db.r4.xlarge. The first DB instance (the instance referenced in this tech support case) was loaded from a 1.002 GB .csv file (a 1M record random sample of voters from all 50 states in the US), which currently uses 1.334GB of storage space in all tables, and shows (in the results from the snapshot taken this morning) that the instance uses 1 GB of storage space. The second instance was loaded from a 4.623GB csv file (4M records describing all voters in the state of Tennessee), which currently uses 3.727 GB of storage space in all tables, and shows (again, in the results from the snapshot taken this morning) that the instance uses 7 GB of storage space.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I consistently get this error (Error Code: 1034. Incorrect key file for table '/rdsdbdata/tmp/#sql_1709_0'; try to repair it) in Amazon Web Services (AWS) Aurora MySQL 5.7 when I run the following INSERT statement (or run the SELECT clause in the INSERT statement as a separate SELECT statement).



      What do I need to change about the INSERT statement (or the AWS Aurora MySQL 5.7 instance or other AWS ecosystem components) so that I don't get this error? (I'm not primarily interested in how to repair the temp table that is referenced in the error message - I want to avoid getting the error in the first place, since this INSERT statement will run as part of a larger script).



      The INSERT statement is as follows:



      INSERT INTO GEO_AREA ( Geo_Area_Nm,     Geo_Area_Abrv,      Geo_Area_Full_Qualfd_Nm,    Geo_Area_Full_Qualfd_Abrv,      
      Geo_Area_Typ_CK, Geo_Area_Prim_ID, Last_Modfd_By_ID, Crtd_By_ID
      )
      SELECT
      Concat("Precinct ", S.PrecinctNumber) AS Geo_Area_Nm, -- The plain Precinct identifier, preceded by the word "Precinct",
      -- without any county or state information added.
      S.PrecinctNumber AS Geo_Area_Abrv, -- The plain Precinct identifier without any county or state information added.
      Concat(S.Jurisname, ", ", STATE.Geo_Area_Nm," - Precinct: ",
      S.PrecinctNumber) AS Geo_Area_Full_Qualfd_Nm, -- [Elector Jurisdiction name, State Name:] Precinct: [Precinct ID]
      Concat(S.Jurisname, ", ", STATE.Geo_Area_Abrv," - Prcnct: ",
      S.PrecinctNumber) AS Geo_Area_Full_Qualfd_Nm, -- [Elector Jurisdiction name, State Name:] Precinct: [Precinct ID]
      @Prcnct_CK AS Geo_Area_Typ_CK, -- => Precinct
      Concat("US-", S.State, "-",S.Juriscode, "-Prcnct:", S.PrecinctNumber) AS Geo_Area_Prim_ID,
      -- Example: US-WY-5602100000-Prcnct:3 08
      Max(Concat("DTVF-", S.SourceID)) As Last_Modfd_By_ID,
      Max(Concat("DTVF-", S.SourceID)) As Crtd_By_ID
      FROM VW_STG_DATA_TRUST_VOTR_INSERT S
      LEFT JOIN GEO_AREA STATE -- STATE is the source of the State name and abbreviation that was loaded in Initial LOAD
      ON Concat('US-',S.State) = STATE.Geo_Area_Prim_ID
      LEFT JOIN GEO_AREA EXIST_GA -- EXIST_GA is the set of records in GEO_AREA before this insert
      ON Concat("US-", S.State, "-",S.Juriscode, "-Prcnct:", S.PrecinctNumber) = EXIST_GA.Geo_Area_Prim_ID
      WHERE STATE.Geo_Area_Typ_CK = @State_CK -- => Connection for US State level info
      -- AND Concat(S.JurisName, ", ", STATE.Geo_Area_Nm) = 'Abbotsford City, Wisconsin'
      AND EXIST_GA.Geo_Area_Prim_ID IS NULL
      GROUP BY 1,2,3,4,5,6
      ;


      I have taken the following steps to try to correct the problem, none of which have worked:



      ⦁ Dropping and recreating the target table (GEO_AREA) in the same AWS Aurora MySQL database instance.



      ⦁ Stopping and restarting the RDS instance.



      ⦁ Creating a new AWS Aurora MySQL 5.7 database instance (wpai-archimedes-dev-dbi) and creating and loading within it a fairly small set of tables and views (including those that are needed to support this INSERT statement). Therefore, I don't think that it is a disk space problem.



      Background:



      ⦁ This INSERT statement (and the SELECT statement within it) draw data from a large staging table/view that contains one row per person/voter and attempts to load one row per [Electoral] Precinct into the Geographic Area (GEO_AREA) table. There can be many rows in the staging table/view that contain voters in a single Electoral Precinct.



      ⦁ I have two similarly structured INSERT statements that load one row per County and and Electoral Jurisdiction into the GEO_AREA table. These two insert statements work properly (without errors). An example of the insert statement that correctly loads counties is at the bottom of this case description.



      ⦁ After receiving this error, I can still run other SQL queries against the GEO_AREA table without getting an error, e.g.,



      SELECT * FROM GEO_AREA WHERE Geo_Area_Typ_CK in (252, 255) order by 6 desc, 4;


      ⦁ Rows for Country and State/Province level geographic areas are loaded into GEO_AREA from a .csv file on my laptop with a LOAD DATA LOCAL INFILE command.



      ⦁ I've tried this INSERT statement in two separate Aurora MySQL database instances. The instance type in both cases is db.r4.xlarge. The first DB instance (the instance referenced in this tech support case) was loaded from a 1.002 GB .csv file (a 1M record random sample of voters from all 50 states in the US), which currently uses 1.334GB of storage space in all tables, and shows (in the results from the snapshot taken this morning) that the instance uses 1 GB of storage space. The second instance was loaded from a 4.623GB csv file (4M records describing all voters in the state of Tennessee), which currently uses 3.727 GB of storage space in all tables, and shows (again, in the results from the snapshot taken this morning) that the instance uses 7 GB of storage space.










      share|improve this question













      I consistently get this error (Error Code: 1034. Incorrect key file for table '/rdsdbdata/tmp/#sql_1709_0'; try to repair it) in Amazon Web Services (AWS) Aurora MySQL 5.7 when I run the following INSERT statement (or run the SELECT clause in the INSERT statement as a separate SELECT statement).



      What do I need to change about the INSERT statement (or the AWS Aurora MySQL 5.7 instance or other AWS ecosystem components) so that I don't get this error? (I'm not primarily interested in how to repair the temp table that is referenced in the error message - I want to avoid getting the error in the first place, since this INSERT statement will run as part of a larger script).



      The INSERT statement is as follows:



      INSERT INTO GEO_AREA ( Geo_Area_Nm,     Geo_Area_Abrv,      Geo_Area_Full_Qualfd_Nm,    Geo_Area_Full_Qualfd_Abrv,      
      Geo_Area_Typ_CK, Geo_Area_Prim_ID, Last_Modfd_By_ID, Crtd_By_ID
      )
      SELECT
      Concat("Precinct ", S.PrecinctNumber) AS Geo_Area_Nm, -- The plain Precinct identifier, preceded by the word "Precinct",
      -- without any county or state information added.
      S.PrecinctNumber AS Geo_Area_Abrv, -- The plain Precinct identifier without any county or state information added.
      Concat(S.Jurisname, ", ", STATE.Geo_Area_Nm," - Precinct: ",
      S.PrecinctNumber) AS Geo_Area_Full_Qualfd_Nm, -- [Elector Jurisdiction name, State Name:] Precinct: [Precinct ID]
      Concat(S.Jurisname, ", ", STATE.Geo_Area_Abrv," - Prcnct: ",
      S.PrecinctNumber) AS Geo_Area_Full_Qualfd_Nm, -- [Elector Jurisdiction name, State Name:] Precinct: [Precinct ID]
      @Prcnct_CK AS Geo_Area_Typ_CK, -- => Precinct
      Concat("US-", S.State, "-",S.Juriscode, "-Prcnct:", S.PrecinctNumber) AS Geo_Area_Prim_ID,
      -- Example: US-WY-5602100000-Prcnct:3 08
      Max(Concat("DTVF-", S.SourceID)) As Last_Modfd_By_ID,
      Max(Concat("DTVF-", S.SourceID)) As Crtd_By_ID
      FROM VW_STG_DATA_TRUST_VOTR_INSERT S
      LEFT JOIN GEO_AREA STATE -- STATE is the source of the State name and abbreviation that was loaded in Initial LOAD
      ON Concat('US-',S.State) = STATE.Geo_Area_Prim_ID
      LEFT JOIN GEO_AREA EXIST_GA -- EXIST_GA is the set of records in GEO_AREA before this insert
      ON Concat("US-", S.State, "-",S.Juriscode, "-Prcnct:", S.PrecinctNumber) = EXIST_GA.Geo_Area_Prim_ID
      WHERE STATE.Geo_Area_Typ_CK = @State_CK -- => Connection for US State level info
      -- AND Concat(S.JurisName, ", ", STATE.Geo_Area_Nm) = 'Abbotsford City, Wisconsin'
      AND EXIST_GA.Geo_Area_Prim_ID IS NULL
      GROUP BY 1,2,3,4,5,6
      ;


      I have taken the following steps to try to correct the problem, none of which have worked:



      ⦁ Dropping and recreating the target table (GEO_AREA) in the same AWS Aurora MySQL database instance.



      ⦁ Stopping and restarting the RDS instance.



      ⦁ Creating a new AWS Aurora MySQL 5.7 database instance (wpai-archimedes-dev-dbi) and creating and loading within it a fairly small set of tables and views (including those that are needed to support this INSERT statement). Therefore, I don't think that it is a disk space problem.



      Background:



      ⦁ This INSERT statement (and the SELECT statement within it) draw data from a large staging table/view that contains one row per person/voter and attempts to load one row per [Electoral] Precinct into the Geographic Area (GEO_AREA) table. There can be many rows in the staging table/view that contain voters in a single Electoral Precinct.



      ⦁ I have two similarly structured INSERT statements that load one row per County and and Electoral Jurisdiction into the GEO_AREA table. These two insert statements work properly (without errors). An example of the insert statement that correctly loads counties is at the bottom of this case description.



      ⦁ After receiving this error, I can still run other SQL queries against the GEO_AREA table without getting an error, e.g.,



      SELECT * FROM GEO_AREA WHERE Geo_Area_Typ_CK in (252, 255) order by 6 desc, 4;


      ⦁ Rows for Country and State/Province level geographic areas are loaded into GEO_AREA from a .csv file on my laptop with a LOAD DATA LOCAL INFILE command.



      ⦁ I've tried this INSERT statement in two separate Aurora MySQL database instances. The instance type in both cases is db.r4.xlarge. The first DB instance (the instance referenced in this tech support case) was loaded from a 1.002 GB .csv file (a 1M record random sample of voters from all 50 states in the US), which currently uses 1.334GB of storage space in all tables, and shows (in the results from the snapshot taken this morning) that the instance uses 1 GB of storage space. The second instance was loaded from a 4.623GB csv file (4M records describing all voters in the state of Tennessee), which currently uses 3.727 GB of storage space in all tables, and shows (again, in the results from the snapshot taken this morning) that the instance uses 7 GB of storage space.







      mysql amazon-web-services






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 18 at 4:36









      SCary

      61




      61
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          I found the problem: I had used the same alias (Geo_Area_Full_Qualfd_Nm) for two separate columns in the SELECT clause. I don’t know why it generated the error message (code 1034) which referred to fixing a temp table. It seems like I remember doing the same thing before in another context a few weeks ago and getting an error message that much more clearly identified the problem, and that led me to solve the issue much more quickly.






          share|improve this answer





















          • Does the SELECT statement by itself trigger the error? I wonder if you're hitting a subtle bug related to using GROUP BY [ordinal position list] instead of column/alias names -- which is not a good practice -- and thus may carry an increased possibly that it exercises a code path that is lacks sufficient sanity checking inside MySQL.
            – Michael - sqlbot
            Nov 18 at 17:22











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53357935%2fwhat-should-i-change-to-avoid-aurora-mysql-error-1034-when-executing-this-insert%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          I found the problem: I had used the same alias (Geo_Area_Full_Qualfd_Nm) for two separate columns in the SELECT clause. I don’t know why it generated the error message (code 1034) which referred to fixing a temp table. It seems like I remember doing the same thing before in another context a few weeks ago and getting an error message that much more clearly identified the problem, and that led me to solve the issue much more quickly.






          share|improve this answer





















          • Does the SELECT statement by itself trigger the error? I wonder if you're hitting a subtle bug related to using GROUP BY [ordinal position list] instead of column/alias names -- which is not a good practice -- and thus may carry an increased possibly that it exercises a code path that is lacks sufficient sanity checking inside MySQL.
            – Michael - sqlbot
            Nov 18 at 17:22















          up vote
          0
          down vote













          I found the problem: I had used the same alias (Geo_Area_Full_Qualfd_Nm) for two separate columns in the SELECT clause. I don’t know why it generated the error message (code 1034) which referred to fixing a temp table. It seems like I remember doing the same thing before in another context a few weeks ago and getting an error message that much more clearly identified the problem, and that led me to solve the issue much more quickly.






          share|improve this answer





















          • Does the SELECT statement by itself trigger the error? I wonder if you're hitting a subtle bug related to using GROUP BY [ordinal position list] instead of column/alias names -- which is not a good practice -- and thus may carry an increased possibly that it exercises a code path that is lacks sufficient sanity checking inside MySQL.
            – Michael - sqlbot
            Nov 18 at 17:22













          up vote
          0
          down vote










          up vote
          0
          down vote









          I found the problem: I had used the same alias (Geo_Area_Full_Qualfd_Nm) for two separate columns in the SELECT clause. I don’t know why it generated the error message (code 1034) which referred to fixing a temp table. It seems like I remember doing the same thing before in another context a few weeks ago and getting an error message that much more clearly identified the problem, and that led me to solve the issue much more quickly.






          share|improve this answer












          I found the problem: I had used the same alias (Geo_Area_Full_Qualfd_Nm) for two separate columns in the SELECT clause. I don’t know why it generated the error message (code 1034) which referred to fixing a temp table. It seems like I remember doing the same thing before in another context a few weeks ago and getting an error message that much more clearly identified the problem, and that led me to solve the issue much more quickly.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 18 at 12:39









          SCary

          61




          61












          • Does the SELECT statement by itself trigger the error? I wonder if you're hitting a subtle bug related to using GROUP BY [ordinal position list] instead of column/alias names -- which is not a good practice -- and thus may carry an increased possibly that it exercises a code path that is lacks sufficient sanity checking inside MySQL.
            – Michael - sqlbot
            Nov 18 at 17:22


















          • Does the SELECT statement by itself trigger the error? I wonder if you're hitting a subtle bug related to using GROUP BY [ordinal position list] instead of column/alias names -- which is not a good practice -- and thus may carry an increased possibly that it exercises a code path that is lacks sufficient sanity checking inside MySQL.
            – Michael - sqlbot
            Nov 18 at 17:22
















          Does the SELECT statement by itself trigger the error? I wonder if you're hitting a subtle bug related to using GROUP BY [ordinal position list] instead of column/alias names -- which is not a good practice -- and thus may carry an increased possibly that it exercises a code path that is lacks sufficient sanity checking inside MySQL.
          – Michael - sqlbot
          Nov 18 at 17:22




          Does the SELECT statement by itself trigger the error? I wonder if you're hitting a subtle bug related to using GROUP BY [ordinal position list] instead of column/alias names -- which is not a good practice -- and thus may carry an increased possibly that it exercises a code path that is lacks sufficient sanity checking inside MySQL.
          – Michael - sqlbot
          Nov 18 at 17:22


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53357935%2fwhat-should-i-change-to-avoid-aurora-mysql-error-1034-when-executing-this-insert%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          If I really need a card on my start hand, how many mulligans make sense? [duplicate]

          Alcedinidae

          Can an atomic nucleus contain both particles and antiparticles? [duplicate]