Browse Source

Mention exit(Pid, normal) in README and a test

Fixes #87
Viktor Söderqvist 6 years ago
parent
commit
95c2ce1eb5
3 changed files with 42 additions and 9 deletions
  1. 12 0
      CHANGELOG.md
  2. 15 9
      README.md
  3. 15 0
      test/mysql_tests.erl

+ 12 - 0
CHANGELOG.md

@@ -1,6 +1,18 @@
 Change log
 ==========
 
+* Mention exit(Pid, normal) in README and a test [2018-11-21 00:51:58 +0100]
+* Return an error on deadlock if all retries fail in a transaction [2018-10-07 20:35:39 +0200]
+* Set gen_server-timeouts for transaction statements to infinity (#91) [2018-10-06 21:39:14 +0200]
+
+1.3.3
+-----
+* Compatibility with OTP 21.1 (#84) [2018-10-02 18:23:43 +0200]
+* Don't restart transaction on lock wait timeout (#89) [2018-09-18 11:10:57 +0200]
+* Make the Travis CI status show the master branch [2018-07-01 00:33:10 +0200]
+* Update README.md [2018-04-13 04:33:52 +0200]
+* Fixed a Typo in the doc [2018-03-21 11:13:26 +0100]
+* Update CHANGELOG.md [2018-03-20 02:44:37 +0100]
 
 1.3.2
 -----

+ 15 - 9
README.md

@@ -2,10 +2,12 @@ MySQL/OTP
 =========
 
 [![Build Status](https://travis-ci.org/mysql-otp/mysql-otp.svg?branch=master)](https://travis-ci.org/mysql-otp/mysql-otp)
+ :link: [Test coverage (EUnit)](//mysql-otp.github.io/mysql-otp/eunit.html)
+ :link: [API documentation (EDoc)](//mysql-otp.github.io/mysql-otp/index.html)
 
-MySQL/OTP is a driver for connecting Erlang/OTP applications to MySQL
-databases (version 4.1 and upward). It is a native implementation of the MySQL
-protocol in Erlang.
+MySQL/OTP is a driver for connecting Erlang/OTP applications to MySQL and
+MariaDB databases. It is a native implementation of the MySQL protocol in
+Erlang.
 
 Some of the features:
 
@@ -23,11 +25,12 @@ Some of the features:
 * Implements both protocols: the binary protocol for prepared statements and
   the text protocol for plain queries.
 
-See also:
+Requirements:
 
-* [API documenation](//mysql-otp.github.io/mysql-otp/index.html) (Edoc)
-* [Test coverage](//mysql-otp.github.io/mysql-otp/eunit.html) (EUnit)
-* [Wiki pages](https://github.com/mysql-otp/mysql-otp/wiki) Connection pooling, related projects and more.
+* Erlang/OTP version R16B or later, excluding 21.0 which has a bug in binary
+  pattern matching. This was fixed in OTP 21.1.
+* MySQL database version 4.1 or later or MariaDB
+* No other dependencies
 
 Synopsis
 --------
@@ -70,6 +73,9 @@ end
 %% Graceful timeout handling: SLEEP() returns 1 when interrupted
 {ok, [<<"SLEEP(5)">>], [[1]]} =
     mysql:query(Pid, <<"SELECT SLEEP(5)">>, 1000),
+
+%% Close the connection; make it exit normally
+exit(Pid, normal).
 ```
 
 Usage as a dependency
@@ -78,13 +84,13 @@ Usage as a dependency
 Using *erlang.mk*:
 
     DEPS = mysql
-    dep_mysql = git https://github.com/mysql-otp/mysql-otp 1.3.2
+    dep_mysql = git https://github.com/mysql-otp/mysql-otp 1.3.3
 
 Using *rebar*:
 
     {deps, [
         {mysql, ".*", {git, "https://github.com/mysql-otp/mysql-otp",
-                       {tag, "1.3.2"}}}
+                       {tag, "1.3.3"}}}
     ]}.
 
 Tests

+ 15 - 0
test/mysql_tests.erl

@@ -89,6 +89,21 @@ common_conn_close() ->
     end,
     process_flag(trap_exit, false).
 
+exit_normal_test() ->
+    Options = [{user, ?user}, {password, ?password}],
+    {ok, Pid} = mysql:start_link(Options),
+    {ok, ok, LoggedErrors} = error_logger_acc:capture(fun () ->
+        %% Stop the connection without noise, errors or messages
+        exit(Pid, normal),
+        receive
+            UnexpectedExitMessage -> UnexpectedExitMessage
+        after 50 ->
+            ok
+        end
+    end),
+    %% Check that we got nothing in the error log.
+    ?assertEqual([], LoggedErrors).
+
 server_disconnect_test() ->
     process_flag(trap_exit, true),
     Options = [{user, ?user}, {password, ?password}],