Giter Club home page Giter Club logo

Comments (3)

vadz avatar vadz commented on August 19, 2024

So I've finally started working on this. The bad news is that actually no backend even sets the indicator correctly currently, here is the result of the tests:

  1. Firebird: indicator is i_ok (the value is, of course, still truncated).
  2. MySQL: indicator is i_ok.
  3. ODBC using PostgreSQL backend: exception thrown.
  4. PostgreSQL: exception thrown.
  5. SQLite: indicator is i_ok.

I can't test Oracle which is a pity because, looking at the code, this is the only backend which has some code for returning i_truncated (ODBC backend also has it but clearly this doesn't work there).

Anyhow, I still think that the current situation is wrong, but it's even wronger than I thought and my changes will break the code for all backends (possibly excluding Oracle) as not only will the indicator be set now if available, but also the exception currently thrown by PostgreSQL backend will not be thrown any more. If anybody objects against changing this and sees some other way of fixing this in a more backward compatible manner, please comment.

from soci.

vadz avatar vadz commented on August 19, 2024

Update: I have now tested with Oracle too and it behaves as PostgreSQL, i.e. an exception is thrown.

So I actually have a new plan: just make all backends throw an exception on truncation except, perhaps, SQLite, which doesn't lose data (even though it doesn't truncate neither).

The main problem I have with this is that I don't know how to make MySQL generate an exception in non-strict mode, would anybody know how to do it? If not, I'll probably just leave MySQL alone.

from soci.

mloskot avatar mloskot commented on August 19, 2024

The new plan sounds good 👍

I don't know. @pfedor is our MySQL guru.

from soci.

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.