Merge branch '2.2' into develop

This commit is contained in:
Markus Mäkelä 2018-05-07 09:57:47 +03:00
commit b6eff12334
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 36 additions and 1 deletions

View File

@ -19,6 +19,26 @@ var os = require('os')
var fs = require('fs')
var readlineSync = require('readline-sync')
function normalizeWhitespace(table) {
table.forEach((v) => {
if (Array.isArray(v)) {
// `table` is an array of arrays
v.forEach((k) => {
if (typeof(v[k]) == 'string') {
v[k] = v[k].replace( /\s+/g, ' ')
}
})
} else if (!Array.isArray(v) && v instanceof Object) {
// `table` is an array of objects
Object.keys(v).forEach((k) => {
if (typeof(v[k]) == 'string') {
v[k] = v[k].replace( /\s+/g, ' ')
}
})
}
})
}
module.exports = function() {
this._ = require('lodash-getpath')
@ -101,7 +121,15 @@ module.exports = function() {
}
this.tableToString = function(table) {
if (this.argv.tsv)
{
// Convert whitespace into spaces to prevent breaking the TSV format
normalizeWhitespace(table)
}
str = table.toString()
if (this.argv.tsv) {
// Based on the regex found in: https://github.com/jonschlinkert/strip-color
str = str.replace( /\x1B\[[(?);]{0,2}(;?\d)*./g, '')

View File

@ -1537,7 +1537,14 @@ static bool reauthenticate_client(MXS_SESSION* session, GWBUF* packetbuf)
proto->scramble, sizeof(proto->scramble),
client_sha1, sizeof(client_sha1));
rval = rc == MXS_AUTH_SUCCEEDED;
if (!(rval = rc == MXS_AUTH_SUCCEEDED))
{
/**
* First packet is COM_CHANGE_USER, the second is AuthSwitchRequest,
* third is the response and the fourth is the following error.
*/
mysql_client_auth_error_handling(session->client_dcb, rc, 3);
}
}
return rval;