The following error shows when loading the "admin/config/search/redirect" page from the Redirect module when using the EntityCache module.
PDOException: SQLSTATE[22018]: [Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting the nvarchar value 'a-filename-pdf' to data type int.: SELECT base.[fid] AS [fid], base.[uid] AS [uid], base.[filename] AS [filename], base.[uri] AS [uri], base.[filemime] AS [filemime], base.[filesize] AS [filesize], base.[status] AS [status], base.[timestamp] AS [timestamp], base.[type] AS [type] FROM {file_managed} base WHERE ( ([base].[fid] IN (:db_condition_placeholder_0)) ); Array ( [:db_condition_placeholder_0] => app-del-xenapp-xendesktop-pdf ) in EntityCacheControllerHelper::entityCacheLoad() (line 100 of entitycache.module).
Comments
Comment #1
DamienMcKennaComment #2
david_garcia CreditAttribution: david_garcia commentedI can acknowledge this happens on serveral places with entitycache.
Something similar in
https://www.drupal.org/node/1444514
The problem is that entitycache is not validating entity ID's before passing them onto the database abstraction layer. MySQL won't complain but MSSQL won't let you do so.
Posgre has the same "problem".
https://www.drupal.org/node/1003788
It's not actually a problem, its the dabase engines trying to tell you to do things right.
Comment #3
DamienMcKennaOh, would you look at that - you're correct, the query specifically says:
[base].[fid] IN (:db_condition_placeholder_0)
and then[:db_condition_placeholder_0] => app-del-xenapp-xendesktop-pdf
so obviously the 'fid' column should be numeric and not a string.Unfortunately the site no longer runs on SQL Server, so I'm not sure I'll be much help in fixing it.
Comment #4
catch#1851398: PDOException:Invalid text representation when attempting to load an entity with a string ID