Skip to content

Commit

Permalink
Merge pull request #4378 from Montellese/mysql_integer_cast_fix
Browse files Browse the repository at this point in the history
mysql: replace all "cast(foo as integer)" to "cast(foo as signed integer)" and not just the first one
  • Loading branch information
jmarshallnz committed Mar 8, 2014
2 parents dc5fff9 + 9cb621e commit 887db48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xbmc/dbwrappers/mysqldataset.cpp
Expand Up @@ -1484,7 +1484,7 @@ bool MysqlDataset::query(const char *query) {
size_t loc;

// mysql doesn't understand CAST(foo as integer) => change to CAST(foo as signed integer)
if ((loc = ci_find(qry, "as integer)")) != string::npos)
while ((loc = ci_find(qry, "as integer)")) != string::npos)
qry = qry.insert(loc + 3, "signed ");

MYSQL_RES *stmt = NULL;
Expand Down

0 comments on commit 887db48

Please sign in to comment.