Git Product home page Git Product logo

Comments (4)

bcardiff avatar bcardiff commented on July 24, 2024 1

I think I got it. In result_set and text_result_set there is a conversion to mimic boolean types since mysql represent as tinyint. That code asumes Int8 (tinyint) is will be present. That seems to not hold on EXISTS result.

Making other ints available in https://github.com/crystal-lang/crystal-mysql/search?utf8=%E2%9C%93&q=from_mysql&type= should be enough.

Do you want to check and send a PR?

from crystal-mysql.

bcardiff avatar bcardiff commented on July 24, 2024

The query_one and others performs a cast without conversions. If the type is not the expected one this kind of errors appear.

You can check rs.read.class to know what type the EXIST is generating and use that type in query_one. From the error it should be an Int64.

I have some thoughts to include some conversions to handle type miss-matches more gracefully. But they are not settled yet.

from crystal-mysql.

Blacksmoke16 avatar Blacksmoke16 commented on July 24, 2024

That makes sense as to why its happening, but it is slightly annoying since it works fine for the PG and Sqlite shards. IMO each DB shard should act in a similar fashion.

Was hoping to use #scalar here but it doesn't allow arguments to be supplied, without just interloping them in the string, like the other query methods do.

from crystal-mysql.

Blacksmoke16 avatar Blacksmoke16 commented on July 24, 2024

Done @bcardiff.

from crystal-mysql.

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.