column names as numbers causes memory exhausted error #94

Open
davidpede opened this Issue Sep 29, 2016 · 2 comments

Projects

None yet

3 participants

@davidpede

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 />

@wshawn
wshawn commented Oct 3, 2016

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?

@Jako
Collaborator
Jako commented Oct 3, 2016

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 …

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment