GithubHelp home page GithubHelp logo

Comments (11)

Philio avatar Philio commented on August 15, 2024

This is strange, I've never had any issue like this from a simple select. Can you provide the table structures please?

from gomysql.

ziutek avatar ziutek commented on August 15, 2024

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.

Philio avatar Philio commented on August 15, 2024

Thanks, will check this out when I get a chance!

from gomysql.

ziutek avatar ziutek commented on August 15, 2024

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.

Philio avatar Philio commented on August 15, 2024

This should be resolved in the latest release.

from gomysql.

thomaslee avatar thomaslee commented on August 15, 2024

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.

thomaslee avatar thomaslee commented on August 15, 2024

Will open a separate issue if this can be reproduced.

from gomysql.

Philio avatar Philio commented on August 15, 2024

I've reopened :)

from gomysql.

ziutek avatar ziutek commented on August 15, 2024

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.

Philio avatar Philio commented on August 15, 2024

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.

Philio avatar Philio commented on August 15, 2024

Fixed, 0.2.5

from gomysql.

Related Issues (20)

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.