thoj / go-mysqlpure Goto Github PK
View Code? Open in Web Editor NEWMySQL client library written in pure Go / golang.
Home Page: http://www.jager.no/
License: BSD 3-Clause "New" or "Revised" License
MySQL client library written in pure Go / golang.
Home Page: http://www.jager.no/
License: BSD 3-Clause "New" or "Revised" License
Hello,
I build Go-MySQL-Client-Library for the last update of go lang.
then got compiling error message.
kevin@X61:~/go/Go-MySQL-Client-Library$ make
/home/kevin/bin/6g -o go.6 mysql.go mysql_const.go mysql_data.go mysql_util.go mysql_stmt.go
mysql.go:208: undefined: strings.Bytes
make: [go.6] Error 1
http://groups.google.com/group/golang-dev/browse_thread/thread/e06c94e94d107fc5#
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench
gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench
The makefile has errors in it which prevent it from building correctly on amd64
Here is a patch which fixes some of the issues:
From 24d856957d21b9e9b96397a48290b6c25ef5e0cf Mon Sep 17 00:00:00 2001 From: Ian Denhardt Date: Wed, 18 Nov 2009 01:30:22 -0500 Subject: [PATCH] Fixed Makefile to build on amd64 --- Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fcc9e99..3038dcb 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,10 @@ clean: 8g test.go 8l -o test test.8 -x64: +amd64: 6g $(GOFILES) 6g test.go - 6l -o test test.8 + 6l -o test test.6 arm: 5g $(GOFILES) -- 1.6.5.2
Note that make clean still fails, because the rule assumes you are on x86. There are a couple ways this could be solved, but I'm not sure what is best.
I like the simple and clear interface design. Thanks. As Go1 has been released, I would like to see this project Go-gettable.
When I run: go get github.com/thoj/Go-MySQL-Client-Library/example, compilation errors appear. Here follows what I did to remove those errors:
Please.
Hi, when I try to connect to MySQL 5.5 the process just hangs...
Would be nice to be able to get the number of resulting rows, I'll try to look into how to do it, but no garantees :P
/Sven
since we don't have the permission of this project.
the first line of install Github url should be:
git clone git://github.com/thoj/Go-MySQL-Client-Library.git
btw, Nice work. Thanks!
package main
import (
"./mysql";
)
func main() {
db := new(mysql.MySQLInstance);
db.Query("SELECT * FROM test");
}
results in
6g test.go && 6l test.6 && ./6.out
SIGSEGV: segmentation violation
Faulting address: 0x0
pc: 0xc296
bufio·_Writer·Write+0x24 /Users/sven/go/src/pkg/bufio/bufio.go:409
bufio·_Writer·Write(0x0, 0x0, 0x2ac258, 0x0, 0x5, ...)
mysql·_MySQLInstance·command+0x84 /Users/sven/gostuff/thoj-Go-MySQL-Client-Library-810076a/mysql.go:152
mysql·_MySQLInstance·command(0x2e22d0, 0x0, 0x2df003, 0x0, 0x59560, ...)
mysql·_MySQLInstance·Query+0x40 /Users/sven/gostuff/thoj-Go-MySQL-Client-Library-810076a/mysql.go:213
mysql·_MySQLInstance·Query(0x2e22d0, 0x0, 0x59560, 0x0, 0x12, ...)
main·main+0x39 /Users/sven/dev/go-http2/test.go:10
main·main()
mainstart+0xf /Users/sven/go/src/pkg/runtime/amd64/asm.s:55
mainstart()
goexit /Users/sven/go/src/pkg/runtime/proc.c:135
goexit()
rax 0x0
rbx 0x2e22d0
rcx 0x0
rdx 0x5
rdi 0x2e3f10
rsi 0x2e3f00
rbp 0x0
rsp 0x2e3e70
r8 0x155
r9 0x2e3e18
r10 0x4b
r11 0x0
r12 0x2b2230
r13 0x0
r14 0x763a8
r15 0x2e2000
rip 0xc296
rflags 0x10246
cs 0x27
fs 0x0
gs 0x0
I have a temporary solution, might not be the best way...
--- orig/mysql_data.go 2009-11-19 04:31:28.000000000 +0100
+++ thoj-Go-MySQL-Client-Library-810076a/mysql_data.go 2009-11-24 18:25:14.000000000 +0100
@@ -85,4 +85,5 @@
type MySQLRow struct {
Data []*MySQLData;
--- orig/mysql.go 2009-11-19 04:31:28.000000000 +0100
+++ thoj-Go-MySQL-Client-Library-810076a/mysql.go 2009-11-24 18:28:02.000000000 +0100
@@ -68,6 +68,7 @@
readHeader(br);
row := new(MySQLRow);
row.Data = make([]*MySQLData, res.ResultSet.FieldCount);
row.Map[res.ResultSet.Fields[i].Name] = data;
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.