Git Product home page Git Product logo

Comments (6)

julienschmidt avatar julienschmidt commented on May 18, 2024

Does this only occur if you run this two queries in that order?
Is the driver on both machines up to date? ( run go get -u github.com/Go-SQL-Driver/MySQL to be sure )
Which server version are you running on your Linux machine?

from mysql.

peterbourgon avatar peterbourgon commented on May 18, 2024

I tried to get some answers to your question. But the problem becomes even more bizarre. Again, on my laptop darwin_amd64, everything works as expected. When I ssh to any linux_amd64 server and run the mysql CLI manually, my manual queries work as expected. But when I run the exact same Go program, now every Query[Row] reports 0 rows returned.

I'm trying to bundle this into a single reproducible test case. Please stay tuned. Do you test this driver on linux_amd64 against MySQL 5.1.63-rel13.4?

from mysql.

peterbourgon avatar peterbourgon commented on May 18, 2024

Create a database on MySQL 5.1.63-rel13.4 with one table:

CREATE TABLE `live` (
  `user_id` int(11) NOT NULL,
  `list` text NOT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

Insert one record:

INSERT INTO live (user_id, list) VALUES (2, "999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999,999999999");

edit: make the list longer, because the real data is bigger than "1,2,3,4,5", and I think it might be the same bug as #38

Save this program as dbtest.go and run with go run dbtest.go -dsn="user:pass@tcp(1.2.3.4:3306)/database_name".

On my laptop (darwin_amd64) it works as expected, printing the list. On my Linux server (linux_amd64) it errors with sql: no rows in result set. Running the latest version of your driver, as retrieved by go get -u -d github.com/Go-SQL-Driver/MySQL in both cases.

from mysql.

peterbourgon avatar peterbourgon commented on May 18, 2024

This is definitely a bug in the Go-SQL-Driver. This code is exactly the same, but uses the mymysql driver (and a different DSN syntax). Running it yields the expected behavior.

from mysql.

julienschmidt avatar julienschmidt commented on May 18, 2024

Can you confirm, that the it works now?

from mysql.

peterbourgon avatar peterbourgon commented on May 18, 2024

Test case confirmed working.

Thanks!

from mysql.

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.