• 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

Jake B.

Well-known member
#1
If you run the Import script more than once you will get the following error if you elect to archive the import log:

Mysqli statement execute error : Table 'archived_import_log' already exists
Shouldn't it just insert the data if the table already exists?

-Jake
 

Kevin

Well-known member
#2
Shouldn't it just insert the data if the table already exists?
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.
 

Jake B.

Well-known member
#4
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.
 

Mike

XenForo developer
Staff member
#5
I think it's worth checking if the table exists to see if we can give a better recommendation.
 

Mike

XenForo developer
Staff member
#6
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:
It is not possible to create the table 'archived_import_log' due to the following error: Mysqli statement execute error : Table 'archived_import_log' already exists
Looking at the code, any DB error that occurs during the rename should print this out.
 

Mike

XenForo developer
Staff member
#7
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.