checker: disallow using builtin type names for const names (#16599)

This commit is contained in:
Swastik Baranwal 2022-12-06 19:14:25 +05:30 committed by GitHub
parent 5fc7b6d3d6
commit ada8643ac5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 34 additions and 15 deletions

View file

@ -76,7 +76,7 @@ pub fn (db Connection) @select(config orm.SelectConfig, data orm.QueryData, wher
f := unsafe { fields[i] }
field_types << unsafe { FieldType(f.@type) }
match types[i] {
orm.string {
orm.type_string {
mysql_bind.buffer_type = C.MYSQL_TYPE_BLOB
mysql_bind.buffer_length = FieldType.type_blob.get_len()
}
@ -276,7 +276,7 @@ fn buffer_to_primitive(data_list []&u8, types []int, field_types []FieldType) ![
orm.type_idx['bool'] {
primitive = *(unsafe { &bool(data) })
}
orm.string {
orm.type_string {
primitive = unsafe { cstring_to_vstring(&char(data)) }
}
orm.time {
@ -322,7 +322,7 @@ fn mysql_type_from_v(typ int) !string {
orm.type_idx['f64'] {
'DOUBLE'
}
orm.string {
orm.type_string {
'TEXT'
}
orm.serial {