Do not die on SQL warning

If we change a field from VARCHAR to enum, we will get warnings as possibly truncating data. Accept this and carry on.

Only fail on an error.
This commit is contained in:
steve-lad 2021-06-27 11:06:33 +02:00
parent d8cc6f3ba1
commit 4fcf16b317
No known key found for this signature in database
GPG key ID: 4D1D760BACDAFF81
3 changed files with 9 additions and 9 deletions

View file

@ -474,11 +474,11 @@ function InstallDB_updateSchema($db_config)
outn("<li>" . _("Modifying table ") . $tabl_name ."</li>"); outn("<li>" . _("Modifying table ") . $tabl_name ."</li>");
$sql_modify = "ALTER TABLE `" . $tabl_name . "` " . substr($sql_modify, 0, -2) . ';'; $sql_modify = "ALTER TABLE `" . $tabl_name . "` " . substr($sql_modify, 0, -2) . ';';
try {
$check = $db->query($sql_modify); $check = $db->query($sql_modify);
if (DB::IsError($check)) { } catch (\Exception $e) {
out("<li>" . print_r($check, 1) . "</li>"); dbug('exception is', $e);
die("Can not modify " . $tabl_name . " table sql: " . $sql_modify . "n"); die_freepbx("Can not modify {$tabl_name}. SQL: {$sql_create} \n");
die_freepbx("Can not modify " . $tabl_name . " table sql: " . $sql_modify . "n");
} }
} }
} }

View file

@ -1,7 +1,7 @@
<module> <module>
<rawname>sccp_manager</rawname> <rawname>sccp_manager</rawname>
<name>SCCP Manager</name> <name>SCCP Manager</name>
<version>14.3.0.0</version> <version>14.3.0.1</version>
<type>setup</type> <type>setup</type>
<category>SCCP Connectivity</category> <category>SCCP Connectivity</category>
<publisher>Steve Lad, Alex GP</publisher> <publisher>Steve Lad, Alex GP</publisher>

View file

@ -185,7 +185,7 @@ trait helperfunctions {
$pkt = unpack("nopcode/nblockno/a*data", $buffer); $pkt = unpack("nopcode/nblockno/a*data", $buffer);
// send ack // send ack
$packet = chr(4) . chr(pkt["blockno"]); $packet = chr(4) . chr($pkt["blockno"]);
socket_sendto($socket, $packet, strlen($packet), MSG_EOR, $host, $port); socket_sendto($socket, $packet, strlen($packet), MSG_EOR, $host, $port);
socket_close($socket); socket_close($socket);