
On 5 December 2011 21:06, Arjen Lentz <arjen@lentz.com.au> wrote:
When storing a string that is longer then the table definition, is it possible to configure mysql to treat this condition as an error and abort the operation, rather then blindly truncating/corrupting the data and reporting a warning? Or does this require using transactions[1]?
sql_mode=TRADITIONAL sets a whole set of options that will do what you want. See ref manual for more detail.
Ok, so that needs to be set for every session, right? i.e. in the client code (I use django).
If an app requires extensive GIS support, I definitely recommend PostgreSQL as it's particularly suited to that task. I see no benefit in a discussion like "is green better than blue" - they are both valid and useful colours.
I don't particularly trust the django mysql code, suspect they didn't really know what they were doing. e.g. this code is called very very frequently: def _valid_connection(self): if self.connection is not None: try: self.connection.ping() return True except DatabaseError: self.connection.close() self.connection = None return False I seem to recall, previous research some time ago they did this as a work around in case the "unexpectedly" closed the connection. As a result, there are many more round trips to the database then needed. My gut feeling is there has to be a better way or resolving any issues then sending a ping packet before every request. Of course I couldn't find the discussion with a quick google search, will try again latter. -- Brian May <brian@microcomaustralia.com.au>