Skip to content

Add support for all flags from mysql in the PDO MySql driver in the getColumnMeta function. #15093

Open
@deAtog

Description

@deAtog

Description

The getColumnMeta function currently returns a small subset of the flags from the native mysql library as shown here:

if (IS_NOT_NULL(F->flags)) {
add_next_index_string(&flags, "not_null");
}
if (IS_PRI_KEY(F->flags)) {
add_next_index_string(&flags, "primary_key");
}
if (F->flags & MULTIPLE_KEY_FLAG) {
add_next_index_string(&flags, "multiple_key");
}
if (F->flags & UNIQUE_KEY_FLAG) {
add_next_index_string(&flags, "unique_key");
}
Please add support for all applicable flags specified here:
#define NOT_NULL_FLAG 1
#define PRI_KEY_FLAG 2
#define UNIQUE_KEY_FLAG 4
#define MULTIPLE_KEY_FLAG 8
#define BLOB_FLAG 16
#define UNSIGNED_FLAG 32
#define ZEROFILL_FLAG 64
#define BINARY_FLAG 128
#define ENUM_FLAG 256
#define AUTO_INCREMENT_FLAG 512
#define TIMESTAMP_FLAG 1024
#define SET_FLAG 2048
#define NO_DEFAULT_VALUE_FLAG 4096
#define ON_UPDATE_NOW_FLAG 8192
#define PART_KEY_FLAG 16384
#define GROUP_FLAG 32768
#define NUM_FLAG 32768

These flags provide valuable information about the column returned and how to potentially process it. For instance, one might need to treat binary strings different from non-binary strings. Without the binary flag, it is impossible to know whether or not a string might require special handling without examining the values of the result set. Additionally, consider adding a native_flags attribute which returns the unmodified numeric value of the flags from the mysql library.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions