Comments (8)
This still happens for me. Just upgraded to this version. The above commit is in the source so I assume that I
am using the version where this is supposed to be fixed.
Any ideas?
from mysql.
It seems that you have made affectedrows=0 an error. Is that your intention?
from mysql.
No sorry, it seems like some code remained there after a (too) long coding night ...
from mysql.
I don't know how to commit back to my github.com repo to do a pull request
but here are the changes I did:
diff --git a/connection.go b/connection.go
index 3a3bb4c..4b6a09e 100644
--- a/connection.go
+++ b/connection.go
@@ -206,7 +206,7 @@ func (mc *mysqlConn) Exec(query string, args
[]driver.Value) (driver.Result, err
}
if mc.affectedRows == 0 && mc.insertId == 0 {
-
return driver.ResultNoRows, e
-
return &mysqlResult{}, nil //driver.ResultNoRows, e } return &mysqlResult{
diff --git a/statement.go b/statement.go
index 746c9dc..dccc64f 100644
--- a/statement.go
+++ b/statement.go
@@ -73,7 +73,7 @@ func (stmt mysqlStmt) Exec(args []driver.Value)
(driver.Result, error) {
}if stmt.mc.affectedRows == 0 {
-
return driver.ResultNoRows, nil
-
return &mysqlResult{}, nil //driver.ResultNoRows, nil } return mysqlResult{
On Wed, Feb 20, 2013 at 4:46 PM, Julien Schmidt [email protected]:
No sorry, it seems like some code remained there after a (too) long coding
night ...β
Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-13835105.
from mysql.
Oops.. forgot the prepared statements.
The ResultNoRows
error is for situations when LastInserID
and AffectedRows
aren't available, but in fact this is in MySQL never the case (every OK
response packet contains these) so this code passage was complete nonsense.
The result of returning &mysqlResult{}
is the same as returning just the normal result - both report 0
(default value) for LastInserID
and AffectedRows
from mysql.
Thanks, I'm not sure if we're talking about the same thing but the reason I
had to change those lines is because driver.ResultNoRows.AffectedRows()
always returns an error.
BTW, thanks for implementing go-sql-driver. It works, and its always good
when something does what it says on the tin.
Cheers,
On Wed, Feb 20, 2013 at 5:03 PM, Julien Schmidt [email protected]:
Oops.. forgot the statements.
The ResultNoRows error is for situations when LastInserID and AffectedRowsaren't available, but in fact this is in MySQL never the case (every
OK response packet contains these) so this code passage was complete
nonsense.The result of returning &mysqlResult{} is the same as returning just the
normal result - both repotz 0 for LastInserID and AffectedRowsβ
Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-13836004.
from mysql.
Which error do you get? no RowsAffected available after DDL statement
? This one should be fixed now π
BTW, thanks for reporting that something didn't work as expected π
from mysql.
Thats the one.
Its from database/sql/sql.go if I remember correctly.
On Wed, Feb 20, 2013 at 5:17 PM, Julien Schmidt [email protected]:
Which error do you get? no RowsAffected available after DDL statement?
This one should be fixed now [image: π]BTW, thanks for reporting that something didn't work as expected [image:
π]β
Reply to this email directly or view it on GitHubhttps://github.com//issues/16#issuecomment-13836777.
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.