Code Monkey home page Code Monkey logo

erlang-mysql-driver's People

Contributors

abecciu avatar ddossot avatar dizzyd avatar ericliang avatar kshamko avatar kzemek avatar moonpolysoft avatar rolong avatar weisslj avatar wlabelle avatar zert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

erlang-mysql-driver's Issues

mysql:init/1 has problem

When I start mysql:init/1, mysql_conn:start/8 returns {error, Reason}, but mysql_recv process has started. I will lead mysql connect hold, mysql will reach max connection as soon as possable.

Test Case:
You can use a database name that not creates.

Empty passwords don't work

The fix is to just add a new function header to mysql_auth:password_new:

  • password_new([], _Salt) ->
  • <<>>;
    
    password_new(Password, Salt) ->
    Stage1 = crypto:sha(Password),

connection broken does not trigger a reconnection

     I had a trouble about firewall when I use this library.The phenomenon is: mysql client A which uses erlang-mysql-driver library connect to mysql server B,and can access to B normal.But after two hours the socket is prevented by firewall,the Keep-Alive msg from B to A is prevented by firewall,the socket is broken,but A don't know!When A send a mysql query msg to B ,then would get a msg said "Failed sending data on socket",Nor would reconnect to B.
     By reading the source code,we know A will reconnect to B only when A receive a "tcp_closed" msg,ie,a tcp_fin msg.So A will not receive "tcp_closed"/tcp_fin msg when firewall work or the socket is broken in some way,nor will reconnect to B.And A will not remove the connection.All of operations just get a return value "Failed sending data on socket".
     So my solution is that add some codes in mysql_conn.erl:470 of do_query(Sock, RecvPid, LogFun, Query, Version)
gen_tcp:close(Sock), RecvPid ! {tcp_closed, Sock},
     That is,when do_send() error,we close this socket,and product a tcp_closed msg,send to the RecvPid.This can notice RecvPid to trigger the reconnection.
     Finally,the author add code for mysql heartbeat and reconnect automatically is the best way!

Failed sending data on socket :close

hi ,dave

this error message occur in my servers, i have no idea what happen ,would you help me.

socket will be close when mysql_recv get the tcp_closed message, and stop the mysql_conn loop/0,

it seems that the socket was already closed, but the loop is not over , does it nomal ?

one question about mysql_recv Socket closed

if mysql socket closed (my be the network broken)
when i fetch

finally go to here:

do_recv(LogFun, RecvPid, SeqNum) when is_function(LogFun);
LogFun == undefined,
SeqNum == undefined ->
receive
{mysql_recv, RecvPid, data, Packet, Num} ->
{ok, Packet, Num};
{mysql_recv, RecvPid, closed, _E} ->
{error, io_lib:format("mysql_recv: socket was closed ~p", [_E])}
end;
do_recv(LogFun, RecvPid, SeqNum) when is_function(LogFun);
LogFun == undefined,
is_integer(SeqNum) ->
ResponseNum = SeqNum + 1,
receive
{mysql_recv, RecvPid, data, Packet, ResponseNum} ->
{ok, Packet, ResponseNum};
{mysql_recv, RecvPid, closed, _E} ->
{error, io_lib:format("mysql_recv: socket was closed ~p", [_E])}
end.

this function return {error, Reason}
the mysql_conn process will already alive but the mysql_recv process dead
why we don't close the mysql_conn process here since it no use!!
it not restart no use

can't return a result set in the given context

mysql:fetch(poolid, <<"call demo.test_return_result_set();">>).
{error,{mysql_result,[],[],0,
<<"#0A000PROCEDURE demo.test_return_result_set can't return a result set in the given context">>}}

CLIENT_MULTI_RESULTS and CLIENT_MULTI_STATEMENTS are not supported?

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.