Skip to content
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

sqlState normalized (error object) && minor version bump && Changelog update #667

Merged
merged 2 commits into from
Nov 9, 2017
Merged

Conversation

williamdes
Copy link
Contributor

Changed sqlState of an error to a string of 5 chars as mysql specifies it [here]
(https://dev.mysql.com/doc/refman/5.5/en/mysql-sqlstate.html) and to align with mysqljs/mysql.

I updated the Changelog and did a minor version bump as asked in #665
I did not find any tests related to sqlState

Test :

var mysql = require('mysql2');
var connection = mysql.createConnection({user: 'xx', password: 'xx', database: 'xx', host: 'xx'});
connection.query("SIGNAL SQLSTATE '02000' SET MESSAGE_TEXT = 'My message', MYSQL_ERRNO = '1999';", function (err, rows) {
  console.log(JSON.stringify(err));
});

Before :

{"errno":1999,"sqlState":"#02000","sqlMessage":"My message"}

After :

{"errno":1999,"sqlState":"02000","sqlMessage":"My message"}

@sidorares sidorares merged commit db13c91 into sidorares:master Nov 9, 2017
@sidorares
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants