dolt: MYSQL_DATA_TRUNCATED error when using C API

Attempted to use dolt’s sql-server with PowerDNS’s gmysqlbackend, but pdns returned error on startup:

Jul 25 02:55:49 Result field at row 33 column 0 has been truncated, we allocated 1 bytes but at least 3 was needed
Jul 25 02:55:49 Result field at row 33 column 1 has been truncated, we allocated 1 bytes but at least 9 was needed
Jul 25 02:55:49 Result field at row 33 column 2 has been truncated, we allocated 1 bytes but at least 67 was needed
Jul 25 02:55:49 Result field at row 33 column 3 has been truncated, we allocated 1 bytes but at least 6 was needed
Jul 25 02:55:49 Could not parse domain kind 'N' as one of 'MASTER', 'SLAVE' or 'NATIVE'. Setting zone kind to 'NATIVE'

Tracing the source code from pdns reveals https://github.com/PowerDNS/pdns/blob/master/modules/gmysqlbackend/smysql.cc#L298

Maybe dolt doesn’t report the size correctly to the client?

(Related issue: https://github.com/PowerDNS/pdns/issues/11803) Relevant code section: https://github.com/PowerDNS/pdns/blob/571146fa726d740ba86028f288c8e1724f04230f/modules/gmysqlbackend/smysql.cc#L237-L247

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

I got the fix merged into go-mysql-server and we’ll pull it into Dolt today and run a release tonight or tomorrow. Thanks again for helping us find this gap and for all the helpful repro details!

Quick update from today’s progress… I’ve got all the types updated to return the max field length and after digging through the MySQL source and docs and testing out all the different types, I think they’re looking pretty good. I’ve started writing tests and will wrap that up tomorrow and hopefully get it out for review, too.

@zllovesukiDolt 0.40.21 was just released and it contains this change to send the max field length of the text serialized data in the response metadata. Check out version 0.40.21 when you get a chance and it should be working smoothly for you.

Please don’t hesitate to open more issues with bugs or feature requests! We love to hear from customers.

Awesome!! Thanks for all these details @zllovesuki! This is all super, super helpful. I’ll dig in and get you an update on my progress by the end of the day.