mirror of
https://github.com/mariadb-corporation/mariadb-connector-nodejs.git
synced 2025-08-15 21:22:32 +00:00
[misc] changing stream event "columns" to "fields" for mysql compatibility
This commit is contained in:
@ -587,7 +587,7 @@ connection.queryStream("SELECT * FROM mysql.user")
|
||||
.on("error", err => {
|
||||
console.log(err); //if error
|
||||
})
|
||||
.on("columns", meta => {
|
||||
.on("fields", meta => {
|
||||
console.log(meta); // [ ...]
|
||||
})
|
||||
.on("data", row => {
|
||||
|
@ -210,7 +210,7 @@ connection.query("SELECT * FROM mysql.user")
|
||||
.on("error", err => {
|
||||
console.log(err); //if error
|
||||
})
|
||||
.on("columns", meta => {
|
||||
.on("fields", meta => {
|
||||
console.log(meta); // [ ... ]
|
||||
})
|
||||
.on("data", row => {
|
||||
|
@ -211,7 +211,7 @@ class ResultSet extends Command {
|
||||
}
|
||||
}
|
||||
|
||||
this.emit("columns", this._columns);
|
||||
this.emit("fields", this._columns);
|
||||
|
||||
return (this.onPacketReceive = info.eofDeprecated
|
||||
? this.readResultSetRow
|
||||
|
@ -18,8 +18,8 @@ class Stream extends Query {
|
||||
}
|
||||
});
|
||||
|
||||
this.on("columns", function(meta) {
|
||||
this.inStream.emit("columns", meta);
|
||||
this.on("fields", function(meta) {
|
||||
this.inStream.emit("fields", meta);
|
||||
});
|
||||
|
||||
this.on("end", function(err) {
|
||||
@ -29,7 +29,9 @@ class Stream extends Query {
|
||||
}
|
||||
|
||||
handleNewRows(row) {
|
||||
if (!this.inStream.push(row)) this.socket.pause();
|
||||
if (!this.inStream.push(row)) {
|
||||
this.socket.pause();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ describe("results-set streaming", () => {
|
||||
.on("error", err => {
|
||||
done(new Error("must not have thrown any error !"));
|
||||
})
|
||||
.on("columns", meta => {
|
||||
.on("fields", meta => {
|
||||
assert.equal(meta.length, 1);
|
||||
metaReceived = true;
|
||||
})
|
||||
@ -67,7 +67,7 @@ describe("results-set streaming", () => {
|
||||
.on("error", err => {
|
||||
done(new Error("must not have thrown any error !"));
|
||||
})
|
||||
.on("columns", meta => {
|
||||
.on("fields", meta => {
|
||||
assert.equal(meta.length, 1);
|
||||
metaReceived = true;
|
||||
})
|
||||
@ -92,7 +92,7 @@ describe("results-set streaming", () => {
|
||||
.on("error", err => {
|
||||
done(new Error("must not have thrown any error !"));
|
||||
})
|
||||
.on("columns", meta => {
|
||||
.on("fields", meta => {
|
||||
assert.equal(meta.length, 1);
|
||||
metaReceived = true;
|
||||
})
|
||||
|
Reference in New Issue
Block a user