Browse Source

Merge pull request #165 from arnehormann/typo-encoded

fix typo (Enoded -> Encoded)
Arne Hormann 12 years ago
parent
commit
12cf283bb5
2 changed files with 10 additions and 10 deletions
  1. 8 8
      packets.go
  2. 2 2
      utils.go

+ 8 - 8
packets.go

@@ -502,34 +502,34 @@ func (mc *mysqlConn) readColumns(count int) ([]mysqlField, error) {
 		}
 
 		// Catalog
-		pos, err := skipLengthEnodedString(data)
+		pos, err := skipLengthEncodedString(data)
 		if err != nil {
 			return nil, err
 		}
 
 		// Database [len coded string]
-		n, err := skipLengthEnodedString(data[pos:])
+		n, err := skipLengthEncodedString(data[pos:])
 		if err != nil {
 			return nil, err
 		}
 		pos += n
 
 		// Table [len coded string]
-		n, err = skipLengthEnodedString(data[pos:])
+		n, err = skipLengthEncodedString(data[pos:])
 		if err != nil {
 			return nil, err
 		}
 		pos += n
 
 		// Original table [len coded string]
-		n, err = skipLengthEnodedString(data[pos:])
+		n, err = skipLengthEncodedString(data[pos:])
 		if err != nil {
 			return nil, err
 		}
 		pos += n
 
 		// Name [len coded string]
-		name, _, n, err := readLengthEnodedString(data[pos:])
+		name, _, n, err := readLengthEncodedString(data[pos:])
 		if err != nil {
 			return nil, err
 		}
@@ -537,7 +537,7 @@ func (mc *mysqlConn) readColumns(count int) ([]mysqlField, error) {
 		pos += n
 
 		// Original name [len coded string]
-		n, err = skipLengthEnodedString(data[pos:])
+		n, err = skipLengthEncodedString(data[pos:])
 		if err != nil {
 			return nil, err
 		}
@@ -587,7 +587,7 @@ func (rows *textRows) readRow(dest []driver.Value) error {
 
 	for i := range dest {
 		// Read bytes and convert to string
-		dest[i], isNull, n, err = readLengthEnodedString(data[pos:])
+		dest[i], isNull, n, err = readLengthEncodedString(data[pos:])
 		pos += n
 		if err == nil {
 			if !isNull {
@@ -1016,7 +1016,7 @@ func (rows *binaryRows) readRow(dest []driver.Value) error {
 			fieldTypeVarString, fieldTypeString, fieldTypeGeometry:
 			var isNull bool
 			var n int
-			dest[i], isNull, n, err = readLengthEnodedString(data[pos:])
+			dest[i], isNull, n, err = readLengthEncodedString(data[pos:])
 			pos += n
 			if err == nil {
 				if !isNull {

+ 2 - 2
utils.go

@@ -603,7 +603,7 @@ func stringToInt(b []byte) int {
 // returns the string read as a bytes slice, wheter the value is NULL,
 // the number of bytes read and an error, in case the string is longer than
 // the input slice
-func readLengthEnodedString(b []byte) ([]byte, bool, int, error) {
+func readLengthEncodedString(b []byte) ([]byte, bool, int, error) {
 	// Get length
 	num, isNull, n := readLengthEncodedInteger(b)
 	if num < 1 {
@@ -621,7 +621,7 @@ func readLengthEnodedString(b []byte) ([]byte, bool, int, error) {
 
 // returns the number of bytes skipped and an error, in case the string is
 // longer than the input slice
-func skipLengthEnodedString(b []byte) (int, error) {
+func skipLengthEncodedString(b []byte) (int, error) {
 	// Get length
 	num, _, n := readLengthEncodedInteger(b)
 	if num < 1 {