Comments (11)
This is strange, I've never had any issue like this from a simple select. Can you provide the table structures please?
from gomysql.
There is table structure with modified field names (security reasons):
CREATE TABLE `SomeTable` (
`id` int(2) unsigned NOT NULL auto_increment,
`s1` varchar(80) NOT NULL default '',
`s2` varchar(50) NOT NULL default '',
`s3` varchar(24) NOT NULL,
`s4` varchar(20) NOT NULL default '',
`s5` varchar(9) default NULL,
`s6` varchar(5) default NULL,
`e1` enum('T','N') NOT NULL default 'T',
`s7` varchar(32) default NULL,
`d1` date NOT NULL default '0000-00-00',
`s8` varchar(80) default NULL,
`s9` varchar(80) default NULL,
`s10` varchar(16) NOT NULL default '',
`d2` date default NULL,
`d3` date default NULL,
`d4` date default NULL,
`d5` date default NULL,
`d6` date default NULL,
`e2` enum('T','N','K') NOT NULL default 'T',
`d7` datetime NOT NULL default '0000-00-00 00:00:00',
`s11` varchar(24) NOT NULL default '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2339 DEFAULT CHARSET=latin2
My MySQL version is: 5.0.51a-24+lenny4-log
I get no errors when select is limited to <300 entries.
from gomysql.
Thanks, will check this out when I get a chance!
from gomysql.
I tried thoj's Go-MySQL-Client-Library. His quickly written code contains a lot of hacks, and poor error checking but after fix to Reader.Read usage it works without this issue (without my fix it doesn't work for long results).
from gomysql.
This should be resolved in the latest release.
from gomysql.
I spoke to ziutek briefly about this issue on the go-nuts mailing list. He had this to say about the issue:
"I realized during writing my package that this bug appears when text result row has NULL value in its first column. GoMySQL treat such Row Data Packet as OK packet and goes into the forest - Polish idiom ;). But this bug can be avoided by using prepared statements."
So this bug should manifest itself when the first column in a result set is NULL. Haven't attempted to reproduce this yet.
from gomysql.
Will open a separate issue if this can be reproduced.
from gomysql.
I've reopened :)
from gomysql.
I made a mistake in the sentence: "bug appears when text result row has NULL value in its first column". I meant an empty string, not a NULL value. NULL in first column gives 251 value in first byte after packet header, and it isn't problem. Empty string gives 0 value in first byte after header and it is treated by GoMySQL as mark of OK packet.
from gomysql.
Ah right, yer that makes sense, as there is no check in place to make sure that the OK packet is the first packet in the set. Of course OK should only occur if it is the first packet!
from gomysql.
Fixed, 0.2.5
from gomysql.
Related Issues (20)
- Query hangs when receive header with len=0 HOT 2
- 'if mysql.reader.Buffered() == 0' probably is a bug HOT 4
- about log HOT 5
- Refactoring of type names HOT 2
- statement.Execute() holds stopping things going... HOT 1
- Bug: statement.Execute() stops the control... HOT 3
- Roadmap [0.3] HOT 16
- Prepare statement hangs when result set has no fields HOT 5
- Parsing of EOF packet not backward compatible HOT 8
- GoMySQL doesn't play nice with goinstall HOT 1
- FetchMap() return []byte, not string. HOT 5
- SELECT numerous columns issue. HOT 6
- interface conversion error INT -> int32 HOT 2
- Doesn't compile under go release.r57.1 HOT 1
- NULL value causes #2000 Unknown MySQL error HOT 3
- Cannot get string result from datetime field HOT 1
- goinstall version is not the latest HOT 1
- Empty string in a varchar column returns Null HOT 1
- Date fields are not supported
- go install and make returns error on OS X HOT 3
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 gomysql.