Coder Social home page Coder Social logo

go-mysqlpure's People

Contributors

michalderkacz avatar thoj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

go-mysqlpure's Issues

Bytes in strings package has been deleted.

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

Makfile has errors which prevent building on amd64

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.

Not Go1 go-gettable.

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:

  1. Rename Go-MySQL-Client-Library into mysql, and change all import "mysql" into import "github.com/thoj/mysql".
  2. Move example/prepare.go into prepare/prepare.go and move example/simple.go into simple/simple.go.

Get number of rows

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

README.markdown install

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!

Crash with segfault when using uninitialized object

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

Some way of getting fields by name

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;

  • Map map[string]*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 = make(map[string]*MySQLData, res.ResultSet.FieldCount);
    if peekEOF(br) { //FIXME: Ignoring EOF and return nil is a bit hackish.
    ignore := make([]byte, 5);
    br.Read(ignore);
    @@ -81,6 +82,7 @@
    data.Length = uint64(len(s));
    data.Type = res.ResultSet.Fields[i].Type;
    row.Data[i] = data;
  •   row.Map[res.ResultSet.Fields[i].Name] = data;
    
    }
    return row;
    }

Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.