[Rt-commit] rt branch 5.0/fulltext-indexer-more-forgiving-encoding-errors created. rt-5.0.2-282-g02cd5d101d

BPS Git Server git at git.bestpractical.com
Thu Jun 30 15:25:06 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/fulltext-indexer-more-forgiving-encoding-errors has been created
        at  02cd5d101d60efda45155643c1da77f37328e17d (commit)

- Log -----------------------------------------------------------------
commit 02cd5d101d60efda45155643c1da77f37328e17d
Author: Brian Conry <bconry at bestpractical.com>
Date:   Thu Jun 30 09:56:55 2022 -0500

    mysql/mariadb fulltext-index better handling of encoding errors
    
    Different versions of mysql and mariadb return different state codes for
    UTF-8 encoding errors.  rt-fulltext-indexer was looking for one
    particular state code (HY000 - general error) and consequently was dying
    due to these errors on some systems instead of ignoring them.
    
    This change removes the state criteria when error 1366
    (ER_TRUNCATED_WRONG_VALUE_FOR_FIELD) is encountered while inserting into
    the index table.

diff --git a/sbin/rt-fulltext-indexer.in b/sbin/rt-fulltext-indexer.in
index e7d104af89..eac7352164 100644
--- a/sbin/rt-fulltext-indexer.in
+++ b/sbin/rt-fulltext-indexer.in
@@ -262,7 +262,7 @@ sub process_mysql {
         },
         sub {
             my ($id) = @_;
-            if ($dbh->err == 1366 and $dbh->state eq "HY000") {
+            if ($dbh->err == 1366) {
                 warn "Attachment $id cannot be indexed. Most probably it contains invalid UTF8 bytes. ".
                     "Error: ". $dbh->errstr;
             } else {

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list