This is the second patch (apply it after the first one).
Summary:
- This is so we can insert Transactions with proper linking between them
---
erlang/mysql/include/mysql.hrl | 1 +
erlang/mysql/src/mysql_conn.erl | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/erlang/mysql/include/mysql.hrl b/erlang/mysql/include/mysql.hrl
index aee5611..1e27152 100644
--- a/erlang/mysql/include/mysql.hrl
+++ b/erlang/mysql/include/mysql.hrl
@@ -3,4 +3,5 @@
{fieldinfo=[],
rows=[],
affectedrows=0,
+ last_insert_id,
error=""}).
diff --git a/erlang/mysql/src/mysql_conn.erl b/erlang/mysql/src/mysql_conn.erl
index 779fd8f..078dd2a 100644
--- a/erlang/mysql/src/mysql_conn.erl
+++ b/erlang/mysql/src/mysql_conn.erl
@@ -652,8 +652,10 @@ get_query_response(LogFun, RecvPid, Version) ->
case Fieldcount of
0 ->
%% No Tabular data
- {AffectedRows, _Rest2} = decode_length(Rest),
- {updated, #mysql_result{affectedrows=AffectedRows}};
+ {AffectedRows, Rest2} = decode_length(Rest),
+ {InsertId, _Rest3} = decode_length(Rest2),
+ {updated, #mysql_result{affectedrows=AffectedRows,
+ last_insert_id = InsertId}};
255 ->
<<_Code:16/little, Message/binary>> = Rest,
{error, #mysql_result{error=Message}};
--
1.5.3.2
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"erlyweb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---