•  » Beta testing
  •  » 12.0.0RC2: Issue with 'rank' reserved word in MySQL?

#1 2021-10-22 03:21:52

windracer
Member
St. Pete, FL
2014-12-28
498

12.0.0RC2: Issue with 'rank' reserved word in MySQL?

Trying to open the "Move" page under Albums in the admin area (admin.php?page=cat_move) results in an error:

Code:

Piwigo encountered an unrecoverable error.
[mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',status, uppercats
  FROM pwg_categories' at line 1

SELECT id,name,rank,status, uppercats
  FROM pwg_categories
;

#1  my_error /usr/local/piwigo/include/dblayer/functions_mysqli.inc.php(132)
#2  pwg_query /usr/local/piwigo/include/dblayer/functions_mysqli.inc.php(888)
#3  query2array /usr/local/piwigo/admin/cat_move.php(138)
#4  include /usr/local/piwigo/admin.php(314)

Seems to be the use of "rank". I had to edit cat_move.php to escape that column with backticks:

Code:

// +-----------------------------------------------------------------------+
// |                          Album display                                |
// +-----------------------------------------------------------------------+

//Get all albums
$query = '
SELECT id,name,`rank`,status, uppercats
  FROM '.CATEGORIES_TABLE.'
;';

$allAlbum = query2array($query);

Offline

 

#2 2021-10-22 17:03:12

erAck
Only trying to help
2015-09-06
2177

Re: 12.0.0RC2: Issue with 'rank' reserved word in MySQL?

I created a pull request.


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2021-10-22 17:20:22

windracer
Member
St. Pete, FL
2014-12-28
498

Re: 12.0.0RC2: Issue with 'rank' reserved word in MySQL?

Thanks. I gotta remember that I can do that myself next time. :)

Offline

 

#4 2021-10-26 15:14:13

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13863

Re: 12.0.0RC2: Issue with 'rank' reserved word in MySQL?

erAck wrote:

I created a pull request.

And it's now merged. Thank you :-)

Offline

 
  •  » Beta testing
  •  » 12.0.0RC2: Issue with 'rank' reserved word in MySQL?

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact