Giter Site home page Giter Site logo

Comments (5)

fulghum avatar fulghum commented on June 12, 2024 2

Good find @ns-kliu. I tracked this down to the JSON_ARRAY function not properly handling arguments when they come in as bind vars, and I opened #1919 with the fix. Thank you for pointing out this problem and sorry about the initial delay in us investigating! 🙏

from go-mysql-server.

ns-kliu avatar ns-kliu commented on June 12, 2024

Can any maintainer have a look?

from go-mysql-server.

timsehn avatar timsehn commented on June 12, 2024

@fulghum will look today.

--Tim

from go-mysql-server.

fulghum avatar fulghum commented on June 12, 2024

Hey @ns-kliu, thanks for taking the time to report this and to provide such a nice repro case! I've got the repro going and am seeing the same behavior you describe. The first thing I've noticed is that the first two queries (which don't return the user that was just created) are both using prepared statements, and the third query (which works correctly) is simply being executed without being prepared and then having bind vars plugged in. Based on that, it seems like there's something going on with query preparation. I've tried disabling prepared statements to confirm that guess, but the configuration I provided doesn't seem to actually disable them.

I'll keep digging in and see what else I can find in the debugger.

from go-mysql-server.

fulghum avatar fulghum commented on June 12, 2024

I kept digging deeper into this one and noticed that the client/GORM is sending over the type CHAR for the bind var, but Vitess is swallowing that info from the client and instead labeling it as VARBINARY when it sends it to go-mysql-server for processing. I just merged in a fix to our fork of Vitess to stop overwriting CHAR with VARBINARY for bind vars, and I confirmed that change enables JSON_ARRAY to handle the prepared query correctly now.

I've got a few more steps to get that change available in go-mysql-server and dolt and will close this issue once those are done.

from go-mysql-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.