Closed remoteportal closed 4 years ago
String readString(int length) {
var s = utf8.decode(_list.sublist(_readPos, _readPos + length)); <= HERE
_readPos += length;
return s;
}
I don't understand your code, but it's dying in the decode routine, that does this:
Converts the UTF-8 codeUnits (a list of unsigned 8-bit integers) to the corresponding string
https://api.dart.dev/stable/2.10.0/dart-convert/Utf8Decoder/convert.html
But the FUNNY thing is that my table doesn't even have any strings!!!
`symID` smallint(4) unsigned not null,
`qs` smallint(5) unsigned not null,
`open` decimal(8,2) unsigned default null,
`high` decimal(8,2) unsigned default null,
`low` decimal(8,2) unsigned default null,
`lp` decimal(8,2) unsigned default null,
`v` int(8) unsigned default null,
primary key (symID, qs)
/// Converts the UTF-8 [codeUnits] (a list of unsigned 8-bit integers) to the
/// corresponding string.
///
/// Uses the code units from [start] to, but no including, [end].
/// If [end] is omitted, it defaults to `codeUnits.length`.
///
/// If the [codeUnits] start with the encoding of a
/// [unicodeBomCharacterRune], that character is discarded.
String convert(List<int> codeUnits, [int start = 0, int? end]) {
// Allow the implementation to intercept and specialize based on the type
// of codeUnits.
var result = _convertIntercepted(_allowMalformed, codeUnits, start, end);
if (result != null) {
return result;
}
return _Utf8Decoder(_allowMalformed).convertSingle(codeUnits, start, end); <====HERE
}
I talked to the Dart team and they are convinced it's a bug in mysql1.
I don't understand how it's so transient... I run it one time and it fails... then, run it a minute later and it succeeds.
There are plenty of places where we are reading a string and assuming it is utf8 when it is not specified in the docs. I've updated the code to soften this assumption.
Can you try running with the master
branch.
I'm with the same error, but in another context. I'm using msix for generate a installer (MSI) where I need to do a certificate (using SSL). Follow the erro itself: flutter pub run msix:create running "flutter build windows"... 113.8s building msix files... \Unhandled exception: FormatException: Missing extension byte (at offset 45)
pub finished with exit code 255
Thank you VERY MUCH for publishing this project! I've been using the library literally every day for six months or so.
I get a FormatException periodically causing a lot of development frustration .
It's sporadic... maybe 50% of the time certain INSERT statements fail. I've found that the longer in characters the INSERT statement , the more likely it is to fail. But, it will happen on very small statements like the following.
Example Statement
Stack trace on Windows:
Connect to database:
Dart Info via Flutter Doctor -v
MariaDB Info:
Execution
I run from Bit Bash command line on Windows 7:
MariaDB Show Variables