-
Notifications
You must be signed in to change notification settings - Fork 2.5k
2.0 release #698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have been using it since alpha8 in a few production apps and have seen to issues so far in my uses cases (using the built-in connection pool, streaming queries, simple placeholders). |
If there is no other objections I'll tag and publish current master as 2.0 in, say, 2 days |
@sidorares I just sent this out: https://twitter.com/felixge/status/420052809930014720 , hopefully a few more people will comment. |
Do you have a full changelog? |
By that I mean something a little smaller than what's in Changes.md that sums up what was added/removed |
@contra so you want a less detailed changelog? Between what versions? |
@felixge I read the changelog and it doesn't look like there were any breakages between 0.9.6 and 2.0 so I should be good to go. |
@contra the big difference between 0.9.6 is |
@contra - Cant't tell much about 0.9 to 2, but there are lots of small features added between first 2-alphaX and latest rc, each deserving minor version bump and at least one deprecation (soon to be backward incompatibility): pooled connection |
I have been using using 2.0 Alpha(currently 2.0.0-alpha9) at production for a while, executing all the regular crud operations, placeholders and connection pooling. No issues. Thanks a lot for your work! |
We're using the v2 release candidates and so far happy with it. Many thanks for all your help and hard work! :) |
We are using 2.0.0-alpha7 and find it very successful. Its really good job 👍 Thank you very much :) |
I'm just commenting now (before I forget), I'm using 2.0.0-alpha7 and I've got a data corruption issue (it's being used in jsbin.com). I'm right now working on a paired down example of the issue. It may turn out not to be the module, but either way, I'll confirm on this thread. |
thanks @remy - I'll wait for your results |
I know isn't a great deal of use, but I'm trying to work out why the database isn't saving the characters in the same encoding as it's being presented (the database is using uft8mb4). Here's a comparison of what is being presented (i.e. that goes through the node-mysql module) and what's saved in the database: I was actually seeing something worse before, but I'm struggling to replicate now: the user content would be saved, and could be retrieved correctly, but after I restarted my server, the data would be retrieved and appear corrupted (I'll see if I can dig out an older example in the database). |
as far as I know driver always serialises string as utf8. It looks like command line client displays utf8 cyrillic interpreted as if it's uft8mb4 |
The thing is, the command line is actually fine (or used to be when working with [email protected]): |
Okay, there's definitely a problem between 0.9 and 2.0. Here's the same code being run, except the first is output from 0.9 and the second is from 2.0 - you can see the second is corrupted output (the row in the database is cyrillic and renders correctly from the mysql cli tool) - make sure to scroll to the right in the code below. 0.9.6:
2.0.0-rc2:
This is the code I'm using for the example: https://github.com/remy/mysql-issue/blob/master/index.js |
@remy we could take a look into this, but it would be even easier if you could do the following to help with repro:
|
This is the CREATE TABLE: CREATE TABLE `sandbox` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`javascript` mediumtext COLLATE utf8mb4_unicode_ci,
`html` mediumtext COLLATE utf8mb4_unicode_ci,
`created` datetime DEFAULT NULL,
`last_viewed` datetime DEFAULT NULL,
`url` char(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`active` char(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'y',
`reported` datetime DEFAULT NULL,
`streaming` char(1) COLLATE utf8mb4_unicode_ci DEFAULT 'n',
`streaming_key` char(32) COLLATE utf8mb4_unicode_ci NOT NULL,
`streaming_read_key` char(32) COLLATE utf8mb4_unicode_ci NOT NULL,
`active_tab` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`active_cursor` int(11) NOT NULL,
`revision` int(11) DEFAULT '1',
`css` mediumtext COLLATE utf8mb4_unicode_ci,
`settings` mediumtext COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`id`),
KEY `viewed` (`last_viewed`),
KEY `url` (`url`(191)),
KEY `streaming_key` (`streaming_key`),
KEY `spam` (`created`,`last_viewed`),
KEY `revision` (`url`(191),`revision`)
) ENGINE=InnoDB AUTO_INCREMENT=1585585 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci Note that ut8mb4 requires a mysql config setup (beyond the scope of node). Including the data and writing and reading back in the JS masks the issue. If there's a bug in mysql@2 it's consistently encoding (incorrectly) and decoding to the original text. A better test is write the string in JS (as you've suggested) and read out in PHP or the mysql cli. Agree? The problem that I'm highlight is that 0.9.x was correctly encoding when writing, but 2.0.0 is not - but I've seen in jsbin.com in production that it is consistent in the encoding error, so new data (written in node-mysql@2) isn't affected. But that doesn't cater for the previous 8mil+ rows that were created (mostly) with node-mysql < 2. |
@remy are you sure it wasn't the old |
Oh, also @remy can you make a new issue for this? That way this issue doesn't get hijacked with this issue. |
@dougwilson that's a fair comment (though if 0.9.x was corrupted the whole time, I've got a metric shit tonne of of duff rows in the database... - but let's not assume the worse). I'll write a php test too (based on the legacy jsbin code) to see what happens and open a new issue for this. |
It looks like a bug in 2.0. Steps to reproduce: in mysql client
node.js (I installed both 0.9.6 and 2rc2 by doing npm install and then renaming corresponding node_modules folder): var mysql96 = require('mysql-0.9.6');
var conn = mysql96.createClient({
user: 'root',
password: '',
database: 'test',
charset: 'UTF8MB4'
});
conn.query('select * from sandbox', function(err, rows) { console.log('0.9.6:', rows[0]); } );
conn.end();
var mysql2rc2 = require('mysql-2rc2');
var conn2 = mysql2rc2.createConnection({
user: 'root',
password: '',
database: 'test',
charset: 'UTF8MB4'
});
conn2.query('select * from sandbox', function(err, rows) { console.log('2.0rc2:', rows[0]); } );
conn2.end(); Results:
So @remy - it looks that your db content created by 0.9.6 is correct one and you won't need migration |
And this is select using console client after inserting using 0.9.6 and 2.0:
|
I think it is because you need to set |
Basically the argument to |
Yep, just found it myself - there is no
@remy - could try with your data when |
If this is confirmed, I think there should be an error raised if |
Yes, I think we should add this check |
@dougwilson thanks for figuring it out. Throwing an error would definitely be great for this. |
@sidorares good god man, this is for you: Phew, I'm seriously relieved this is fixed - I was getting a touch worried that I was going to be stuck in the land of weird data. My work is done here. |
@remy You are welcome :) |
✔ |
I feel like 2.0 is ready for release, but I'd like to hear feedback from those using node-mysql in production. If we don't have blockers, let's release 2.0 - I have lots planned changes which require minor version bump (ssl, compression, prepared statements,
resultAsArray
flag etc)( see also similar discussion 6 month ago - #526 )
The text was updated successfully, but these errors were encountered: