xpdo icon indicating copy to clipboard operation
xpdo copied to clipboard

column names as numbers causes memory exhausted error

Open davidpede opened this issue 9 years ago • 2 comments

Jason, as discussed in Slack. Using numbers as column names in a custom db table seemed to cause a loop which eventually exhausts memory. Looks like XPDO is treating them as non-strings. Adding a row to table $xpdo->newObject was the trigger in this case.

This is the loop: (DEBUG @ C:\xampp\htdocs\repo\revolution\core\xpdo\xpdo.class.php : 1362)</h5><pre>Returning ancestry for myTableName: Array ( [0] => xPDOSimpleObject [1] => xPDOObject )

Which results in: <b>Fatal error</b>: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes) in <b>C:\xampp\htdocs\repo\revolution\core\xpdo\om\xpdoobject.class.php</b> on line <b>2390</b><br />

davidpede avatar Sep 29 '16 11:09 davidpede

This might be a legitimate bug, but I am sorely interested in why column names would be numbers? Doesn't that defeat the whole OOP thing?

wshawn avatar Oct 03 '16 12:10 wshawn

It could be a database restriction: http://dev.mysql.com/doc/refman/5.7/en/identifiers.html

Identifiers may begin with a digit but unless quoted may not consist solely of digits.

Maybe they are not quoted by xPDO for some reason …

Jako avatar Oct 03 '16 13:10 Jako