You can change the mysql config to apply the set options.
sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
However this is not always desireable on shared hosting you don't know the follow on effects.
So far, I've found I can simply set this in the installer and the db connection class.
include/database/PearDatabase.php
Search for function connect
Apply this code under the if for isdb_default_utf8_charset
if($this->isdb_default_utf8_charset) {
$this->executeSetNamesUTF8SQL(true);
}
if ($this->dbType === 'mysql') {
$this->database->Execute("SET SESSION sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'");
}
And for the installer
Edit the modules/Install/models/Utils.php After the mysql_server_version = self::getMySQLVersion($serverInfo);
Put this to set the options for the sql mode for the session.
$conn->Execute("SET SESSION sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'");
Note: Without this in the include/database/PearDatabase.php I was able to add lead but editing and updating the fields afterwards did not work silently failing.