/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.shardingsphere.db.protocol.mysql.packet.command.query;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * MySQL Column Field Detail Flag.
 * 
 * @see <a href="https://mariadb.com/kb/en/library/resultset/#field-detail-flag">Field detail flag</a>
 */
@RequiredArgsConstructor
@Getter
public enum MySQLColumnFieldDetailFlag {

    NOT_NULL(1),

    PRIMARY_KEY(2),

    UNIQUE_KEY(4),

    MULTIPLE_KEY(8),

    BLOB(16),

    UNSIGNED(32),

    ZEROFILL_FLAG(64),

    BINARY_COLLATION(128),

    ENUM(256),

    AUTO_INCREMENT(512),

    TIMESTAMP(1024),

    SET(2048),

    NO_DEFAULT_VALUE_FLAG(4096),

    ON_UPDATE_NOW_FLAG(8192),

    NUM_FLAG(32768);
    
    private final int value;
}

@@ -1171,16 +1171,25 @@
 OT_NULL(
+0x0000000
 1),%0A%0A   
@@ -1201,16 +1201,25 @@
 ARY_KEY(
+0x0000000
 2),%0A%0A   
@@ -1230,16 +1230,25 @@
 QUE_KEY(
+0x0000000
 4),%0A%0A   
@@ -1261,16 +1261,25 @@
 PLE_KEY(
+0x0000000
 8),%0A%0A   
@@ -1288,10 +1288,18 @@
 LOB(
-16
+0x00000010
 ),%0A%0A
@@ -1311,18 +1311,26 @@
 NSIGNED(
-32
+0x00000020
 ),%0A%0A    
@@ -1347,10 +1347,18 @@
 LAG(
-64
+0x00000040
 ),%0A%0A
@@ -1382,11 +1382,18 @@
 ION(
-128
+0x00000080
 ),%0A%0A
@@ -1405,11 +1405,18 @@
 NUM(
-256
+0x00000100
 ),%0A%0A
@@ -1438,11 +1438,18 @@
 ENT(
-512
+0x00000200
 ),%0A%0A
@@ -1466,12 +1466,18 @@
 AMP(
-1024
+0x00000400
 ),%0A%0A
@@ -1488,12 +1488,18 @@
 SET(
-2048
+0x00000800
 ),%0A%0A
@@ -1528,12 +1528,18 @@
 LAG(
-4096
+0x00001000
 ),%0A%0A
@@ -1565,12 +1565,18 @@
 LAG(
-8192
+0x00002000
 ),%0A%0A
@@ -1592,13 +1592,18 @@
 LAG(
-32768
+0x00008000
 );%0A 

Use hex to represent MySQLColumnFieldDetailFlag value (#13313)