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

Confusion over query/execute's return type union via Promise API #24

Open
theFroh opened this issue Jun 26, 2018 · 1 comment · May be fixed by #34
Open

Confusion over query/execute's return type union via Promise API #24

theFroh opened this issue Jun 26, 2018 · 1 comment · May be fixed by #34

Comments

@theFroh
Copy link

theFroh commented Jun 26, 2018

Upon console logging an INSERT, I can see the following:

ResultSetHeader {
    fieldCount: 0,
    affectedRows: 1,
    insertId: 0,
    info: '',
    serverStatus: 2,
    warningStatus: 1 }

This would imply that there's a warning. What return packet type would contain this information?

The signature for .query is RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[], and since this is an INSERT I'd expect the result to be an OkPacket if anything, however the OkPacket type definition is:

OkPacket {
    constructor: {
        name: 'OkPacket'
    };
    fieldCount: number;
    affectedRows: number;
    changedRows: number;
    insertId: number;
    serverStatus: number;
    warningCount: number;
    message: string;
    procotol41: boolean;
}

Observations:

  • warningStatus vs warningCount
  • procotol41 (odd spelling, can't find any reference to this elsewhere)

So unless I typecast as any I don't believe I can determine if a query has had a warning, but I'd just like to confirm if this is the case and raise this just in case there is indeed an issue in the definition.

@dctrotz
Copy link
Contributor

dctrotz commented May 27, 2020

I am seeing the same thing, yet, this issue seems stalled. :-/

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 a pull request may close this issue.

2 participants