From 43ec6f96fc82dee2851c9ff26a078b76ca46a27d Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 23 Aug 2023 10:22:13 +0800 Subject: [PATCH] Process/FixMysqlCharset.php --- Process/FixMysqlCharset.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Process/FixMysqlCharset.php b/Process/FixMysqlCharset.php index f105ee76..bb0cbe07 100644 --- a/Process/FixMysqlCharset.php +++ b/Process/FixMysqlCharset.php @@ -43,6 +43,9 @@ class Pman_Core_Process_FixMysqlCharset extends Pman_Core_Cli { } touch('/tmp/fix_mysql_charset_'. $opts['table']); + $this->disableTriggers($opts['table']); + $this->enableTriggers($opts['table']); + $t = DB_DataObject::factory($opts['table']); $cols = $t->tableColumns(); $t->selectAdd(); @@ -98,4 +101,13 @@ class Pman_Core_Process_FixMysqlCharset extends Pman_Core_Cli { exit; } + + function disabletriggers($tbl) + { + $t = DB_DataObject::factory($tbl); + $t->query("SHOW TRIGGERS FROM {$t->databaseName()} where `table` = '{$tbl}"); + $t->find(); + $ar = $t->fetchAll(); + print_r($ar);exit; + } } -- 2.39.2