Skip to content

Commit

Permalink
removed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Philio committed Feb 25, 2011
1 parent 46be3af commit 2c65a22
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 75 deletions.
22 changes: 11 additions & 11 deletions Makefile
Expand Up @@ -2,16 +2,16 @@ include $(GOROOT)/src/Make.inc

TARG=mysql
GOFILES=mysql.go\
types.go\
const.go\
error.go\
password.go\
reader.go\
writer.go\
packet.go\
convert.go\
handler.go\
result.go\
statement.go
types.go\
const.go\
error.go\
password.go\
reader.go\
writer.go\
packet.go\
convert.go\
handler.go\
result.go\
statement.go

include $(GOROOT)/src/Make.pkg
13 changes: 1 addition & 12 deletions README.markdown
@@ -1,16 +1,11 @@
<<<<<<< HEAD
GoMySQL Version 0.2.10
======================
=======
GoMySQL Version 0.3.0-beta-1
============================
>>>>>>> dev


Revision History
----------------

0.3.x series [development]
0.3.x series [testing]

* 0.3.0-beta-1 - Added full statement and functions. Refactored packet handlers into generic functions. Added new BindResult/Fetch method to get result data from prepared statements. Added type conversions for similar types to populate the result pointers with values from the row data. Added simple type conversion to standard queries. Added automatic reconnect for a select number of operations. Added greater number of client errors from the MySQL manual. Added date/time types to allow date/time elements to be stored as integers and ints, making them more useful.
* 0.3.0-alpha-3 - Added new error structs ClientError and ServerError. Replaced majority of os.Error/os.NewError functionality with MySQL specific ClientError objects. Server error responses now return a ServerError. Removed Client.Errno and Client.Error. Added deferred error processing to reader, writer and packets to catch and errors and always return a ClientError. Rewrote auto reconnect to check for specific MySQL error codes.
Expand All @@ -19,15 +14,9 @@ Revision History

0.2.x series [current]

<<<<<<< HEAD
* 0.2.12 - Forgot to bump the version constant.
* 0.2.11 - Fix a bug in getPrepareResult() causing queries returning no fields (e.g. DROP TABLE ...) to hang.
* 0.2.10 - Compatability update for Go release.2011-01-20
=======
* 0.2.12 - Fix a bug in getPrepareResult() causing queries returning no fields (e.g. DROP TABLE ...) to hang.
* 0.2.11 - Skipped
* 0.2.10 - Compatibility update for Go release.2011-01-20
>>>>>>> dev
* 0.2.9 - Added support for MySQL 5.5
* 0.2.8 - Fixes issue #38.
* 0.2.7 - Added additional binary type support: medium int (int32/uint32), decimal (string), new decimal (string), bit ([]byte), year (uint16), set ([]byte), enum/set use string type.
Expand Down
52 changes: 0 additions & 52 deletions mysql.go
Expand Up @@ -20,12 +20,6 @@ import (

// Constants
const (
<<<<<<< HEAD
Version = "0.2.12"
DefaultPort = 3306
DefaultSock = "/var/run/mysqld/mysqld.sock"
MaxPacketSize = 1 << 24
=======
// General
VERSION = "0.3.0-beta-1"
DEFAULT_PORT = "3306"
Expand All @@ -48,7 +42,6 @@ const (
RESULT_STORED = 0x1
RESULT_USED = 0x2
RESULT_FREE = 0x3
>>>>>>> dev
)

// Client struct
Expand Down Expand Up @@ -592,12 +585,6 @@ func (c *Client) dial() (err os.Error) {
}
return
}
<<<<<<< HEAD
// Get packet
pkt := new(packetInit)
pkt.header = hdr
err = pkt.read(mysql.reader)
=======
// Log connect success
c.log(1, "Connected to server")
// Create reader and writer
Expand All @@ -614,7 +601,6 @@ func (c *Client) init() (err os.Error) {
c.log(1, "Reading handshake initialization packet from server")
// Read packet
p, err := c.r.readPacket(PACKET_INIT)
>>>>>>> dev
if err != nil {
return
}
Expand Down Expand Up @@ -650,43 +636,6 @@ func (c *Client) init() (err os.Error) {
return
}

<<<<<<< HEAD
/**
* Generic function to determine type of result packet received and process it
*/
func (mysql *MySQL) getResult() (err os.Error) {
// Get header and validate header info
hdr := new(packetHeader)
err = hdr.read(mysql.reader)
// Read error
if err != nil {
if mysql.connected {
// Assume lost connection to server
mysql.error(CR_SERVER_LOST, CR_SERVER_LOST_STR)
} else {
mysql.error(CR_SERVER_HANDSHAKE_ERR, CR_SERVER_HANDSHAKE_ERR_STR)
}
return os.NewError("An error occured receiving packet from MySQL")
}
// Check sequence number
if hdr.sequence != mysql.sequence {
mysql.error(CR_COMMANDS_OUT_OF_SYNC, CR_COMMANDS_OUT_OF_SYNC_STR)
return os.NewError("An error occured receiving packet from MySQL")
}
// Read the next byte to identify the type of packet
c, err := mysql.reader.ReadByte()
mysql.reader.UnreadByte()
switch {
// Unknown packet, remove it from the buffer
default:
bytes := make([]byte, hdr.length)
_, err = io.ReadFull(mysql.reader, bytes)
// Set error response
if err != nil {
err = os.NewError("An unknown packet was received from MySQL, in addition an error occurred when attempting to read the packet from the buffer: " + err.String());
} else {
err = os.NewError("An unknown packet was received from MySQL")
=======
// Send auth packet to the server
func (c *Client) auth() (err os.Error) {
// Log write packet
Expand Down Expand Up @@ -719,7 +668,6 @@ func (c *Client) auth() (err os.Error) {
if c.serverFlags&CLIENT_CONNECT_WITH_DB > 0 && len(c.dbname) > 0 {
p.clientFlags |= uint32(CLIENT_CONNECT_WITH_DB)
p.database = c.dbname
>>>>>>> dev
}
} else {
p.scrambleBuff = scramble323(c.scrambleBuff, []byte(c.passwd))
Expand Down

0 comments on commit 2c65a22

Please sign in to comment.