Page MenuHomeMiraheze

Cargo command error
Closed, InvalidPublic

Description

  • Problem: Using HOLDS, HOLDS LIKE, WITHIN or HOLDS WITHIN on the where= field gives a a SQL error, even though the syntax is correct.

Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'HOLDS '<NAME>' ORDER BY _pageName,Nome LIMIT 100' at line 1 (db13.miraheze.org)
Function: CargoSQLQuery::run Query: SELECT _pageName AS Dex,Nome AS Nome FROM cargo__<TABLE> WHERE Nome HOLDS '<NAME>' ORDER BY _pageName,Nome LIMIT 100

  • <TABLE> is the Cargo table and <NAME> is the word after the command in the where field.

I personally don't know how exactly the DB backend works, but I never had a problem using the said commands. Considering the recent outages and the mention of MariaDB, it may have something to do with it, but I'm not sure.

Example page on my wiki

I was also unable to use the commands on my alternative wiki (and this one has only 10 rows in the table)

Event Timeline

Considering the recent outages and the mention of MariaDB

I doubt it.

The cause of this error is the wrong SQL syntax. For the record, the query you're trying to execute doesn't work:

MariaDB [pokemundowiki]> SELECT `_pageName` AS `Dex`,`Nome` AS `Nome` FROM `cargo__Pokémon` WHERE Nome HOLDS 'Pikachu' ORDER BY `_pageName`,`Nome` LIMIT 100;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'HOLDS 'Pikachu' ORDER BY `_pageName`,`Nome` LIMIT 100' at line 1

Which is because 'HOLDS' is not a valid expression in SQL in MariaDB. When replacing it with '=' (check if a column's value is equal to 'Pikachu'), there's no error:

MariaDB [pokemundowiki]> SELECT `_pageName` AS `Dex`,`Nome` AS `Nome` FROM `cargo__Pokémon` WHERE Nome='Pikachu' ORDER BY `_pageName`,`Nome` LIMIT 100;
+---------+---------+
| Dex     | Nome    |
+---------+---------+
| Pikachu | Pikachu |
+---------+---------+
1 row in set (0.001 sec)

I know that 'HOLDS' has a special meaning in Cargo, but it doesn't look like the Cargo extension convers the 'HOLDS' command into valid SQL queries anymore?

Considering the recent outages and the mention of MariaDB

I doubt it.

The cause of this error is the wrong SQL syntax. For the record, the query you're trying to execute doesn't work:

MariaDB [pokemundowiki]> SELECT `_pageName` AS `Dex`,`Nome` AS `Nome` FROM `cargo__Pokémon` WHERE Nome HOLDS 'Pikachu' ORDER BY `_pageName`,`Nome` LIMIT 100;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'HOLDS 'Pikachu' ORDER BY `_pageName`,`Nome` LIMIT 100' at line 1

Which is because 'HOLDS' is not a valid expression in SQL in MariaDB. When replacing it with '=' (check if a column's value is equal to 'Pikachu'), there's no error:

MariaDB [pokemundowiki]> SELECT `_pageName` AS `Dex`,`Nome` AS `Nome` FROM `cargo__Pokémon` WHERE Nome='Pikachu' ORDER BY `_pageName`,`Nome` LIMIT 100;
+---------+---------+
| Dex     | Nome    |
+---------+---------+
| Pikachu | Pikachu |
+---------+---------+
1 row in set (0.001 sec)

I know that 'HOLDS' has a special meaning in Cargo, but it doesn't look like the Cargo extension convers the 'HOLDS' command into valid SQL queries anymore?

Oh I forgot about this task. I think I'm misremembering exactly, because I got it to work when a field was List (,) of Strings. For some reason, I thought it also worked with simple String (and related) fields. Although, the error message is a bit unclear for me, especially mentioning "LIMIT", so I interpreted as something related to the DB.

Sorry about this :(

HOWEVER
I still have to mention an actual bug: I can't see one of my tables for some reason, but it works normally. This happened just after the recent outage.

Just commenting because I don't know if it's worth a task (considering the table is working as intended, just its the page not working)

HOWEVER
I still have to mention an actual bug: I can't see one of my tables for some reason, but it works normally. This happened just after the recent outage.

Just commenting because I don't know if it's worth a task (considering the table is working as intended, just its the page not working)

Opened T7003