From 654b3f5531937086b03b1a5b00aafa236b07957c Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Tue, 4 Mar 2014 14:20:27 +0100 Subject: [PATCH] Fix the condition handler fix for #40. Refrain from trying to display the character where we found a decoding error when the error actually happens at end-of-input-in-character... --- src/sources/mysql.lisp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sources/mysql.lisp b/src/sources/mysql.lisp index 08592a8..fc79666 100644 --- a/src/sources/mysql.lisp +++ b/src/sources/mysql.lisp @@ -78,7 +78,13 @@ (pgstate-incf *state* (target mysql) :read 1) (funcall process-row-fn row)))) (handler-bind - ((babel-encodings:character-decoding-error + ;; avoid trying to fetch the character at end-of-input position... + ((babel-encodings:end-of-input-in-character + #'(lambda (c) + (pgstate-incf *state* (target mysql) :errs 1) + (log-message :error "~a" c) + (invoke-restart 'qmynd-impl::use-nil))) + (babel-encodings:character-decoding-error #'(lambda (c) (pgstate-incf *state* (target mysql) :errs 1) (let ((encoding (babel-encodings:character-coding-error-encoding c))