Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293925

MySQL Database Connection isn't serializable

$
0
0

A mysql database connection is serialized by cloning the current object; removing the connection, schema and driverClasses to save space; serializing the result; and destroying the cloned stripped down object. When the object is destroyed mysql deconstructor will call nextIdDelete() to cleanup the sequences table but now that the object doesn't have a connection the attempt fails and results in an error.

There's already some special handling around this code for the testing case where the connection object is mocked. As a quick fix I've added in some additional code to check for the case where it's just not set at all but this doesn't seem like an ideal solution. Injecting a dummy connection object before destroying the mysql object might be better but I thought I'd see if anyone else had a better idea before writing that.


Viewing all articles
Browse latest Browse all 293925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>