User:Taylan/CargoBugTest: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{#cargo_query: tables = item_icon |fields=TRIM(icon),CONCAT('', '40'),LOWER(rarity),CONCAT('', '{{{show_rarity|}}}'),CONCAT('', "{{{name|Confessions, Vol. 1, Father Lorgan}}}") |where={{#if:{{{uid|}}}|item_icon.uid = "{{{uid}}}"|item_icon._pageName="{{{name|Confessions, Vol. 1, Father Lorgan}}}"}} |limit=1 |order by=item_icon._pageName |default={{ItemIcon Internal|{{{name|Confessions, Vol. 1, Father Lorgan}}} Unfaded Icon.png|40|common| true|{{{name|Confessions, Vol. 1,...") |
No edit summary |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{#cargo_query: tables = | This page showcases a bug in the Cargo extension. Auto-generated column names break upon the presence of a period. | ||
|fields= | |||
|where={{# | === Example 1 === | ||
<pre> | |||
| | {{#cargo_query: tables = weapons | ||
| fields = name, CONCAT("Test1.Test2.Test3.") | |||
| | | where = name = "Adamantine Longsword" | ||
| | }} | ||
</pre> | |||
{{#cargo_query: tables = weapons | |||
| fields = name, CONCAT("Test1.Test2.Test3.") | |||
| where = name = "Adamantine Longsword" | |||
}} | |||
=== Example 2 === | |||
The behavior changes depending on whether there's a space after the period. | |||
This one causes an error to be logged by PHP, saying the column <code>" Test2. Test3."</code> couldn't be found, and the data isn't shown. | |||
<pre> | |||
{{#cargo_query: tables = weapons | |||
| fields = name, CONCAT("Test1. Test2. Test3.") | |||
| where = name = "Adamantine Longsword" | |||
}} | |||
</pre> | |||
{{#cargo_query: tables = weapons | |||
| fields = name, CONCAT("Test1. Test2. Test3.") | |||
| where = name = "Adamantine Longsword" | |||
}} | |||
=== Example 3 === | |||
To work around the bug, make sure to give the column a proper name: | |||
<pre> | |||
{{#cargo_query: tables = weapons | |||
| fields = name, CONCAT("Test1.Test2.Test3.") = test | |||
| where = name = "Adamantine Longsword" | |||
}} | |||
</pre> | |||
{{#cargo_query: tables = weapons | |||
| fields = name, CONCAT("Test1.Test2.Test3.") = test | |||
| where = name = "Adamantine Longsword" | |||
}} | }} | ||
- | === Example 4 === | ||
The space after the period also doesn't matter anymore if you use that work-around: | |||
<pre> | |||
{{#cargo_query: tables = weapons | |||
| fields = name, CONCAT("Test1. Test2. Test3.") = test | |||
| where = name = "Adamantine Longsword" | |||
}} | |||
</pre> | |||
{{#cargo_query: tables = | {{#cargo_query: tables = weapons | ||
|fields= | | fields = name, CONCAT("Test1. Test2. Test3.") = test | ||
|where= | | where = name = "Adamantine Longsword" | ||
}} | }} |
Latest revision as of 02:19, 6 June 2024
This page showcases a bug in the Cargo extension. Auto-generated column names break upon the presence of a period.
Example 1[edit | edit source]
{{#cargo_query: tables = weapons | fields = name, CONCAT("Test1.Test2.Test3.") | where = name = "Adamantine Longsword" }}
name | Test2.Test3.") |
---|---|
Adamantine Longsword | Test1.Test2.Test3. |
Example 2[edit | edit source]
The behavior changes depending on whether there's a space after the period.
This one causes an error to be logged by PHP, saying the column " Test2. Test3."
couldn't be found, and the data isn't shown.
{{#cargo_query: tables = weapons | fields = name, CONCAT("Test1. Test2. Test3.") | where = name = "Adamantine Longsword" }}
name | Test2. Test3.") |
---|---|
Adamantine Longsword |
Example 3[edit | edit source]
To work around the bug, make sure to give the column a proper name:
{{#cargo_query: tables = weapons | fields = name, CONCAT("Test1.Test2.Test3.") = test | where = name = "Adamantine Longsword" }}
name | test |
---|---|
Adamantine Longsword | Test1.Test2.Test3. |
Example 4[edit | edit source]
The space after the period also doesn't matter anymore if you use that work-around:
{{#cargo_query: tables = weapons | fields = name, CONCAT("Test1. Test2. Test3.") = test | where = name = "Adamantine Longsword" }}
name | test |
---|---|
Adamantine Longsword | Test1. Test2. Test3. |