Comments (9)
I tried to fix (c *Conn) writeResultset
, but it's not trivial.
r.Fields
contains nil values [ <NIL> <NIL> <NIL> ]
, and then a Dump()
is called on that.
from go-mysql.
I think I got it, can you have a look?
https://github.com/siddontang/go-mysql/pull/31/files
Thanks
from go-mysql.
Thanks @medvednikov
what's your test sql? or can you add this test like in go-mysql/client ?
from go-mysql.
Sorry, didn't make it clear that I was using the server package. I'm building a small MySQL proxy.
I had a look at server_test.go, you are always returning []interface{}{1, "hello world"}
, so it's not possible to test empty results.
This is one of the possible queries:
select str, f, e from mixer_test_conn where false
from go-mysql.
Thanks, I will see it on weekend.
from go-mysql.
Hi @medvednikov
I found the problem in mysql/resultset_helper.go BuildSimpleTextResultset, if the resultset is empty, the field can't be made correctly.
So maybe the best way to build result fields is to retrieve these in table directly, not from return rows values. Your PR only ignores this error, but we will still get an invalid data, you can use a wireshark to test in real mysql and can see that if the rows is empty, we can still get correct fields response.
Sorry that I don't have any time to fix or improve this. 😭
from go-mysql.
Hi @siddontang
Thanks for debugging this.
With my fix I get Empty set (0.07 sec)
, the same response a real MySQL server sends me.
I don't know the MySQL protocol well enough to see what's missing there :)
If this PR doesn't break anything, could you please approve it, since it fixes our problem, and it would be nice not to have to maintain a fork.
Thanks
from go-mysql.
Hi @medvednikov
You should use wireshark to capture the mysql protocol, and you can see it.
Only using mysql client doesn't work.
from go-mysql.
I merge this, but maybe we could find a better way later.
from go-mysql.
Related Issues (20)
- How to start binlog syncer from last position HOT 3
- Tables
- Why In OnRow e.Header is nil ,no e.Header.LogPos
- canal can't send create index and drop index sql HOT 2
- MySQL 8.3 will introduce new GTID format
- [Warning] Aborted connection 52412 to db: 'unconnected' user: 'boss' host: '' (Got an error reading communication packets) HOT 7
- how to remove log output HOT 2
- column values missing
- help to understand why do we dump some data first before sync the data from binlog HOT 4
- How to use TRANSACTION_CONTEXT_EVENT for the replication HOT 2
- Driver Compression Enablement HOT 4
- Enabling compression on client connection results in "connection was bad" error HOT 4
- Setting collations need adjustment HOT 2
- Support MySQL 8.4.0
- Client unable to select from function when compression is enabled. HOT 5
- to exclude databases with ExcludeTableRegex
- Random connection failure in readInitialHandshake() HOT 12
- Add support for using RDS IAM with canal HOT 2
- Can I use this library to parse bytes to MySQL protocol? HOT 1
- There is one more column when consuming Alibaba Cloud PolarDB HOT 11
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 go-mysql.