1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

As Designed Mysqli statement execute error : Table 'archived_import_log' already exists

Discussion in 'Resolved Bug Reports' started by Jake B., Mar 5, 2015.

  1. Jake B.

    Jake B. Well-Known Member

    If you run the Import script more than once you will get the following error if you elect to archive the import log:

    Shouldn't it just insert the data if the table already exists?

    -Jake
     
  2. Kevin

    Kevin Well-Known Member

    No, because you might be importing from multiple sources. It's why at the end of an import you are prompted for the name of the table to create -- it defaults to to "archive_import_log" but you can change it to whatever you want.
     
  3. Chris D

    Chris D XenForo Developer Staff Member

    Yep. One import log per import.
     
  4. Jake B.

    Jake B. Well-Known Member

    Perhaps a nicer message saying to change the name of it and show the input instead of the mysql error? The credits add-on uses the import system for importing credits from other add-ons, and a couple of people have brought this up so far.
     
  5. Mike

    Mike XenForo Developer Staff Member

    I think it's worth checking if the table exists to see if we can give a better recommendation.
     
  6. Mike

    Mike XenForo Developer Staff Member

    Can you show the full backtrace with that error? I chose the option to archive the import log (when restarting) and it gave me the following:
    Looking at the code, any DB error that occurs during the rename should print this out.
     
  7. Mike

    Mike XenForo Developer Staff Member

    Wait, are you reporting that it prints this error out? From your original report it seemed to imply it was an uncaught exception and thus logging as an error.

    This is actually capturing any error. It's unlikely to trigger another error, but it certainly could if the table name isn't valid for example. As such, we're just deferring to the actual error from MySQL which will be the most accurate in determining what's wrong and the action that needs to be taken.

    As such, I think I will call this as designed.
     

Share This Page