Upgrading Craft 2 to 3 hits database error
This sounds like a bug, you should probably report it directly to support@craftcms.com.

I'm posting this as an answer however, because you may be able to skirt the issue... Try updating to Craft 3.0.x first, and then updating the 3.1.x from there.