I am returning a short array via:
return $stmt->fetchAll( PDO::FETCH_ASSOC );
and running into a very strange issue. In my test case, I have three rows of data. Each row has a unique ID, a processed flag, and a content varchar:
`incomingstring` VARCHAR(5000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL;
This varchar contains a multiline string, delimited by CRLF terminated with message suffix:
define( "MESSAGE_SUFFIX", '\x7c\x1c\x0d' );
I parse this string for message parts. The problem is that not everything is returning as expected. The first row returns fine. The second and third row return, but only part (the last part) of the message returns. I know the data is there, I can see it if I look into the database directly, but what comes into the array does not contain the whole varchar.
My best guess is that the termination character is messing up the associative array in some way? Maybe? Any suggestions for a fix? I can't tear the control characters out of the DB record itself because I need them there for other processes, this parser needs to be able to read the data without altering it.
Using MySQL 8.0.11 and PHP 7.2.7
Thanks!