GithubHelp home page GithubHelp logo

Comments (3)

RoyBellingan avatar RoyBellingan commented on July 3, 2024

I think the error arise from a difference between mysql and mariadb (I am running mariadb 11.0.2)

The error returned by mariadb is Duplicate entry '[email protected]' for key 'email'

The expected one would have been

The error returned by mariadb is Duplicate entry '[email protected]' for key 'users.email'

The fix is just to replace the string check there
https://github.com/anarthal/servertech-chat/blob/master/server/src/services/mysql_client.cpp#L262
https://github.com/anarthal/servertech-chat/blob/master/server/src/services/mysql_client.cpp#L265

I will not open a pull request as it will take more time than editing on the fly those 2 lines.

from servertech-chat.

anarthal avatar anarthal commented on July 3, 2024

Thanks for the catch. That's a non-potability between MySQL and MariaDB, which is indicating this is not the right way to handle it. We probably want to inspect the exiting user on failure to determine what happened, or an equivalent strategy. What you propose is an acceptable workaround as long as you're running MariaDB.

from servertech-chat.

RoyBellingan avatar RoyBellingan commented on July 3, 2024

The workaround above also work for mysql btw.
I checked and looks like is not possible to have a deterministic way to see which column went in collision -.-

In theory, but not for now, is possible to read on connection what DB is beeing used, and have a dedicated list to intercept those kind of error... ?

from servertech-chat.

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.