-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Information mandatory field #798
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'm not sure what you're asking for. The |
Sorry, I would like to know if you know whether a field accepts null or not. In this case this information would need to come together with other field information in the information fields result. |
which column would this be in the packet I linked to?
I'm not sure what this means. |
Sorry for my english... In "Protocol::ColumnDefinition41", there is the possibility of whether a field accepts null values? By Not Null option. |
By example: With SQL command "SHOW COLUMNS FROM tablename" I can get the information if the field accepts null values or not. |
Gotcha. Yes, you can tell: connection.query('SELECT col1 FROM my_table', function(err, rows, fields){
if (err) throw err;
var nullable = !(fields[0].flags & 0x01);
console.log('col1 can' + (nullable ? '' : ' not') + ' be null');
}); It should probably be easier, or at the very least, not require you to know that the first bit of the flag means the field it not nullable. |
ok. Thank´s! |
* travis: add mysql 8.0 env * travis: disable version check for mysql 8 debian does not have a compatible client yet * travis: set local-infile=1 * travis: try to fix waiting for mysql 8 and optimize wait time * travis: show output of wait script * travis: grep for successful execution * travis: remove sleep
In the results of query part "fields" not return information for mandatory field join others information of field.
The text was updated successfully, but these errors were encountered: