Comments (7)
FYI: I've had to fork and reset to beta3 to make it work again. I plan to delete my fork when this is fixed.
from mysql.
While the database/sql
package is able to convert from int*
-> *string
, it is unable to convert to *[]byte
. This is not specific to *sql.RawBytes
. Also this is not a driver issue.
Before beta 4 this driver returned every value as []byte
. For int*
values this means converting the []byte
(Little Endian representation) from the stream to an integer value, formatting it as a string and return the string as []byte
(string representation this time) again, which obviously has a lot of overhead.
According to the database/sql/driver
specification it is completely fine to return an int64
value.
So we can skip the string formatting an converting string -> []byte part.
Therefor this is an driver/sql
package issue. I'm working on a fix anyways.
For all that, your query should work fine in go tip / Go 1.1, where the Queryer
driver interface is available. This allows this driver to run queries without args with the MySQL text protocol (In Go 1 every query must use prepared statements, which use the binary protocol) where everything is already returned in string representation, which is why everything is still returned as a []byte
value.
from mysql.
Hotfix for $GOROOT/src/pkg/database/sql/convert.go
(Go 1.0.3)
Patch: http://files.julienschmidt.com/public/gostuff/convert.go.patch
Fixed File: http://files.julienschmidt.com/public/gostuff/convert.go
After replacing delete the folder $GOROOT/pkg/<arch>/database/
and run go test -i
in $GOROOT/src/pkg/database/sql/
then
I send out a CL for go later. I'm on my Notebook. I must set up gcc + hg + codereview tool first :)
from mysql.
π Thank you for all the explanation, the patch, and your time! π―
I'll probably wait for Go 1.1 to get back using to your repo since I don't need too much performance for my small tool right now and Go 1.1 is right near the corner.
from mysql.
https://codereview.appspot.com/7783046
from mysql.
Merged in tip since devel +1ec96e11707f, yay!!!
from mysql.
π congratz!
from mysql.
Related Issues (20)
- Cut a new v1.7.2 release HOT 14
- Potential out of bound access in `(*mysqlConn).handleErrorPacket` HOT 7
- Toggle Click in Leaderboards
- mysql startWatcher panic error HOT 3
- Bizarre hanging issue in rows.Close() HOT 7
- Can't Install, bug in edwards25519/scalar.go HOT 1
- Likely race that can prevent to recycle closed connections HOT 5
- Return timeout error instead of Invalid connection err when read packet network timeout HOT 5
- δΏεζΆζ₯ιοΌPrepared statement contains too many placeholders
- too may ram usage when lost connection HOT 13
- SEGV writing packet HOT 1
- Connection liveness/goodeness check and AWS Aurora HOT 1
- Data race between mysqlConn watcher and okHandler during context cancellation HOT 3
- v1.6.0 get error
- Data race between mysqlConn.cleanup() and writeHandshakeResponsePacket HOT 2
- MaxOpenConns is not working
- Receiving "(using password: NO)" when password was given HOT 2
- Why must use port 3306?
- Scanner should return one of int64,float64,bool,[]byte,string,time.Time,nil , but I got uint64 HOT 3
- Do I need logic backup mysql data using mysqldump while I have master-slave mysql cluster.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mysql.