ElkArte Community

General => OpenImporter => Topic started by: McFly on February 10, 2022, 03:47:11 am

Title: SMF 2.0.19 to EA 1.1.18 problem
Post by: McFly on February 10, 2022, 03:47:11 am
Everything works fine except:

This query:
QuoteREPLACE INTO database1.ea_custom_fields
(col_name, field_name, field_desc, field_type, field_length, field_options, mask, show_reg, show_display, show_profile, private, active, bbc, can_search, default_value, enclose, placement, rows, cols)
VALUES('cust_gender', 'Gender', 'Your gender', 'radio', 15, 'undisclosed,male,female,genderless,nonbinary,transgendered', '', 0, 1, 'forumprofile', 0, 1, 0, 0, 'undisclosed', '', 0, 0, 0);

Caused the error:
QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rows, cols)
VALUES('cust_gender', 'Gender', 'Your gender', 'radio', 15, '...' at line 2
Title: Re: SMF 2.0.19 to EA 1.1.18 problem
Post by: Spuds on February 10, 2022, 09:47:01 pm
I believe that is because MariaDB added the "rows" name as reserved as of 10.2.4.  So that query would need to be updated to use a fully qualified reference like database1.ea_custom_fields.rows :(
Title: Re: SMF 2.0.19 to EA 1.1.18 problem
Post by: McFly on February 11, 2022, 04:11:48 am
Quote from: Spuds – I believe that is because MariaDB added the "rows" name as reserved as of 10.2.4.  So that query would need to be updated to use a fully qualified reference like database1.ea_custom_fields.rows :(

Hm ... I don't think so. After all, the installation process of ElkArte uses the same SQL query. And it runs even without error message.  :(
Title: Re: SMF 2.0.19 to EA 1.1.18 problem
Post by: tino on February 11, 2022, 05:29:45 am
You need the ‘’ around the rows keyword, in the actual insert query part.
Title: Re: SMF 2.0.19 to EA 1.1.18 problem
Post by: McFly on February 11, 2022, 06:32:23 am
Quote from: tino – You need the ‘’ around the rows keyword, in the actual insert query part.

Just tested the query with ' and " around rows. Same error.   :'(

EDIT: cry emo does not compute!  ;)
Title: Re: SMF 2.0.19 to EA 1.1.18 problem
Post by: McFly on February 11, 2022, 06:56:37 am
I just truncated the SQL query after 'placement', as well as the values. Works.

After that 'rows, cols' in a separate query. Does not work.  ???
Title: Re: SMF 2.0.19 to EA 1.1.18 problem
Post by: Arantor on February 11, 2022, 07:50:53 am
It’s not the ' mark you have to use, but the ` mark. They’re visually similar but they mean different things…
Title: Re: SMF 2.0.19 to EA 1.1.18 problem
Post by: tino on February 11, 2022, 08:02:36 am
Quote from: Arantor – It’s not the ' mark you have to use, but the ` mark. They’re visually similar but they mean different things…

As Arantor said the backtick, it seems typing from my phone has changed it to a ‘ so apologies. This is MySQL only mind, Postgres doesn’t support it.
Title: Re: SMF 2.0.19 to EA 1.1.18 problem
Post by: McFly on February 11, 2022, 09:21:26 am
Ah ... now, yes... worked. Or as they say here casually: Now it becomes a shoe.
But why does the installation of ElkArte work without errors? Is the quotation mark already implemented there?


@Tino With my autocorrect apostrophes or quotation marks are also sometimes degraded to commas.
Title: Re: SMF 2.0.19 to EA 1.1.18 problem
Post by: McFly on February 13, 2022, 03:46:28 am
Time to relax on Sunday morning. Added the "backtick" in the smf2-0_importer.xml file about line 780 three times around the "rows". The data transfer from SMF 2.0.19 has now worked fine.

For interested the file in the attachment.