Browse Source

Fix typos in comments (#192)

Kian-Meng Ang 3 years ago
parent
commit
32327c217f

+ 1 - 1
include/records.hrl

@@ -57,7 +57,7 @@
                     status :: integer(),
                     warning_count :: integer()}).
 
-%% Response of a successfull prepare call.
+%% Response of a successful prepare call.
 -record(prepared, {statement_id :: integer(),
                    orig_query :: iodata(),
                    param_count :: integer(),

+ 2 - 2
src/mysql.erl

@@ -641,7 +641,7 @@ transaction(Conn, Fun, Retries) ->
 %% using e.g. `ok = mysql:query(Pid, "SELECT some_non_existent_value")'. An
 %% exception to this is the error 1213 "Deadlock", after the specified number
 %% of retries, all failed. In this case, the transaction is aborted and the
-%% error is retured as the reason for the aborted transaction, along with a
+%% error is returned as the reason for the aborted transaction, along with a
 %% stacktrace pointing to where the last deadlock was detected. (In earlier
 %% versions, up to and including 1.3.2, transactions where automatically
 %% restarted also for the error 1205 "Lock wait timeout". This is no longer the
@@ -727,7 +727,7 @@ execute_transaction(Conn, Fun, Args, Retries) ->
         ?EXCEPTION(throw, {implicit_rollback, 1, Reason}, Stacktrace)
           when Retries == 0 ->
             %% No more retries. Return 'aborted' along with the deadlock error
-            %% and a the trace to the line where the deadlock occured.
+            %% and a the trace to the line where the deadlock occurred.
             Trace = ?GET_STACK(Stacktrace),
             %% In MySQL < 5.7, we are still in a transaction here, but in 5.7+
             %% we're not.  The ROLLBACK executed here has no effect if no

+ 1 - 1
src/mysql_conn.erl

@@ -443,7 +443,7 @@ handle_call(reset_connection, _From, #state{socket = Socket, sockmod = SockMod}
         #ok{} -> ok;
         #error{} = E ->
             %% 'COM_RESET_CONNECTION' is added in MySQL 5.7 and MariaDB 10
-            %% "Unkown command" is returned when MySQL =< 5.6 or MariaDB =< 5.5
+            %% "Unknown command" is returned when MySQL =< 5.6 or MariaDB =< 5.5
             {error, error_to_reason(E)}
     end,
     {reply, Reply, State1};

+ 2 - 2
src/mysql_protocol.erl

@@ -490,7 +490,7 @@ build_handshake_response(Handshake, Username, Password, Database,
     <<ClientCapabilityFlags:32/little,
       ?MAX_BYTES_PER_PACKET:32/little,
       CharacterSet:8,
-      0:23/unit:8, %% reserverd
+      0:23/unit:8, %% reserved
       UsernameUtf8/binary,
       0, %% NUL-terminator for the username
       HashLength,
@@ -894,7 +894,7 @@ null_bitmap_encode(NullBitstring, BitOffset) ->
 reverse_byte(<<A:1, B:1, C:1, D:1, E:1, F:1, G:1, H:1>>) ->
     <<H:1, G:1, F:1, E:1, D:1, C:1, B:1, A:1>>.
 
-%% @doc Used for executing prepared statements. The bit offset whould be 0 in
+%% @doc Used for executing prepared statements. The bit offset would be 0 in
 %% this case.
 -spec build_null_bitmap([any()]) -> binary().
 build_null_bitmap(Values) ->

+ 1 - 1
test/mysql_protocol_tests.erl

@@ -54,7 +54,7 @@ resultset_test() ->
 
 resultset_error_test() ->
     %% A query that returns a response starting as a result set but then
-    %% interupts itself and decides that it is an error.
+    %% interrupts itself and decides that it is an error.
     Query = <<"EXPLAIN SELECT * FROM dual;">>,
     ExpectedReq = <<(size(Query) + 1):24/little, 0, ?COM_QUERY, Query/binary>>,
     ExpectedResponse = hexdump_to_bin(

+ 1 - 1
test/transaction_tests.erl

@@ -107,7 +107,7 @@ application_process_kill() ->
 
     ?assertNot(is_process_alive(Pid)),
 
-    %% Check that the transaction was not commited
+    %% Check that the transaction was not committed
     {ok, Pid2} = mysql:start_link([
         {user, ?user},
         {password, ?password},