MySQL 9.0.0
Source Code Documentation
key_spec.h File Reference
#include <sys/types.h>
#include "lex_string.h"
#include "my_base.h"
#include "nulls.h"
#include "sql/mem_root_array.h"
#include "sql/sql_list.h"

Go to the source code of this file.

Classes

class  KEY_CREATE_INFO
 
class  Key_part_spec
 
class  Key_spec
 
class  Foreign_key_spec
 

Enumerations

enum  keytype {
  KEYTYPE_PRIMARY , KEYTYPE_UNIQUE , KEYTYPE_MULTIPLE , KEYTYPE_FULLTEXT ,
  KEYTYPE_SPATIAL , KEYTYPE_FOREIGN
}
 
enum  fk_option {
  FK_OPTION_UNDEF , FK_OPTION_RESTRICT , FK_OPTION_CASCADE , FK_OPTION_SET_NULL ,
  FK_OPTION_NO_ACTION , FK_OPTION_DEFAULT
}
 
enum  fk_match_opt { FK_MATCH_UNDEF , FK_MATCH_FULL , FK_MATCH_PARTIAL , FK_MATCH_SIMPLE }
 
enum  enum_order : int { ORDER_NOT_RELEVANT = 1 , ORDER_ASC , ORDER_DESC }
 

Functions

bool foreign_key_prefix (const Key_spec *a, const Key_spec *b)
 Test if a foreign key (= generated key) is a prefix of the given key (ignoring key name, key type and order of columns) More...
 

Variables

KEY_CREATE_INFO default_key_create_info
 

Enumeration Type Documentation

◆ enum_order

enum enum_order : int
Enumerator
ORDER_NOT_RELEVANT 
ORDER_ASC 
ORDER_DESC 

◆ fk_match_opt

Enumerator
FK_MATCH_UNDEF 
FK_MATCH_FULL 
FK_MATCH_PARTIAL 
FK_MATCH_SIMPLE 

◆ fk_option

enum fk_option
Enumerator
FK_OPTION_UNDEF 
FK_OPTION_RESTRICT 
FK_OPTION_CASCADE 
FK_OPTION_SET_NULL 
FK_OPTION_NO_ACTION 
FK_OPTION_DEFAULT 

◆ keytype

enum keytype
Enumerator
KEYTYPE_PRIMARY 
KEYTYPE_UNIQUE 
KEYTYPE_MULTIPLE 
KEYTYPE_FULLTEXT 
KEYTYPE_SPATIAL 
KEYTYPE_FOREIGN 

Function Documentation

◆ foreign_key_prefix()

bool foreign_key_prefix ( const Key_spec a,
const Key_spec b 
)

Test if a foreign key (= generated key) is a prefix of the given key (ignoring key name, key type and order of columns)

Note
This is only used to test if an index for a FOREIGN KEY exists. We only compare field names.
Return values
falseGenerated key is a prefix of other key
trueNot equal

Variable Documentation

◆ default_key_create_info

KEY_CREATE_INFO default_key_create_info
extern