From 2c65a224bbf25ed57c3e7b88dc8ccea18df9478c Mon Sep 17 00:00:00 2001 From: Philio Date: Fri, 25 Feb 2011 01:59:35 +0000 Subject: [PATCH] removed conflicts --- Makefile | 22 ++++++++++----------- README.markdown | 13 +------------ mysql.go | 52 ------------------------------------------------- 3 files changed, 12 insertions(+), 75 deletions(-) diff --git a/Makefile b/Makefile index 60b2fda..38de3b1 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.markdown b/README.markdown index b9be55e..08ed666 100644 --- a/README.markdown +++ b/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. @@ -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. diff --git a/mysql.go b/mysql.go index ce01fa1..a2f4e83 100644 --- a/mysql.go +++ b/mysql.go @@ -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" @@ -48,7 +42,6 @@ const ( RESULT_STORED = 0x1 RESULT_USED = 0x2 RESULT_FREE = 0x3 ->>>>>>> dev ) // Client struct @@ -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 @@ -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 } @@ -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 @@ -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))