53
53
/* out: table name */
54
54
const char* name); /* in: table name in the form
55
55
dbname '/' tablename */
56
/**************************************************************************
57
Returns a table object based on table id. */
62
/* out: table, NULL if does not exist */
63
dulint table_id, /* in: table id */
64
trx_t* trx); /* in: transaction handle */
65
56
/************************************************************************
66
57
Decrements the count of open MySQL handles to a table. */
69
60
dict_table_decrement_handle_count(
70
61
/*==============================*/
71
dict_table_t* table, /* in/out: table */
72
ibool dict_locked); /* in: TRUE=data dictionary locked */
62
dict_table_t* table); /* in: table */
73
63
/**************************************************************************
74
64
Inits the data dictionary module. */
166
172
const char* name); /* in: column name */
167
173
/************************************************************************
168
174
Acquire the autoinc lock.*/
171
177
dict_table_autoinc_lock(
172
178
/*====================*/
173
dict_table_t* table); /* in/out: table */
179
dict_table_t* table); /* in: table */
174
180
/************************************************************************
175
181
Initializes the autoinc counter. It is not an error to initialize an already
176
182
initialized counter. */
179
185
dict_table_autoinc_initialize(
180
186
/*==========================*/
181
dict_table_t* table, /* in/out: table */
182
ib_uint64_t value); /* in: next value to assign to a row */
187
dict_table_t* table, /* in: table */
188
ib_longlong value); /* in: next value to assign to a row */
183
189
/************************************************************************
184
190
Reads the next autoinc value (== autoinc counter value), 0 if not yet
188
194
dict_table_autoinc_read(
189
195
/*====================*/
190
/* out: value for a new row, or 0 */
191
const dict_table_t* table); /* in: table */
196
/* out: value for a new row, or 0 */
197
dict_table_t* table); /* in: table */
192
198
/************************************************************************
193
199
Updates the autoinc counter if the value supplied is equal or bigger than the
194
200
current value. If not inited, does nothing. */
197
203
dict_table_autoinc_update(
198
204
/*======================*/
200
dict_table_t* table, /* in/out: table */
201
ib_uint64_t value); /* in: value which was assigned to a row */
206
dict_table_t* table, /* in: table */
207
ib_longlong value); /* in: value which was assigned to a row */
202
208
/************************************************************************
203
209
Release the autoinc lock.*/
206
212
dict_table_autoinc_unlock(
207
213
/*======================*/
208
dict_table_t* table); /* in/out: table */
214
dict_table_t* table); /* in: table */
209
215
/**************************************************************************
210
216
Adds system columns to a table object. */
213
219
dict_table_add_system_columns(
214
220
/*==========================*/
224
230
mem_heap_t* heap); /* in: temporary heap */
225
231
/**************************************************************************
226
232
Removes a table object from the dictionary cache. */
229
235
dict_table_remove_from_cache(
230
236
/*=========================*/
231
237
dict_table_t* table); /* in, own: table */
232
238
/**************************************************************************
233
239
Renames a table object. */
236
242
dict_table_rename_in_cache(
237
243
/*=======================*/
238
244
/* out: TRUE if success */
239
dict_table_t* table, /* in/out: table */
245
dict_table_t* table, /* in: table */
240
246
const char* new_name, /* in: new name */
241
247
ibool rename_also_foreigns);/* in: in ALTER TABLE we want
242
248
to preserve the original table name
264
270
ibool check_charsets);/* in: TRUE=check charset
266
272
/*************************************************************************
267
Check if the index is referenced by a foreign key, if TRUE return the
268
matching instance NULL otherwise. */
271
dict_table_get_referenced_constraint(
272
/*=================================*/
273
/* out: pointer to foreign key struct if index
274
is defined for foreign key, otherwise NULL */
275
dict_table_t* table, /* in: InnoDB table */
276
dict_index_t* index); /* in: InnoDB index */
277
/*************************************************************************
278
273
Checks if a table is referenced by foreign keys. */
281
dict_table_is_referenced_by_foreign_key(
282
/*====================================*/
283
/* out: TRUE if table is referenced
285
const dict_table_t* table); /* in: InnoDB table */
286
/**************************************************************************
287
Replace the index in the foreign key list that matches this index's
288
definition with an equivalent index. */
291
dict_table_replace_index_in_foreign_list(
292
/*=====================================*/
293
dict_table_t* table, /* in/out: table */
294
dict_index_t* index); /* in: index to be replaced */
276
dict_table_referenced_by_foreign_key(
277
/*=================================*/
278
/* out: TRUE if table is referenced by a
280
dict_table_t* table); /* in: InnoDB table */
295
281
/**************************************************************************
296
282
Determines whether a string starts with the specified keyword. */
299
285
dict_str_starts_with_keyword(
300
286
/*=========================*/
304
290
const char* str, /* in: string to scan for keyword */
305
291
const char* keyword); /* in: keyword to look for */
306
292
/*************************************************************************
307
Checks if a index is defined for a foreign key constraint. Index is a part
308
of a foreign key constraint if the index is referenced by foreign key
309
or index is a foreign key index */
312
dict_table_get_foreign_constraint(
313
/*==============================*/
314
/* out: pointer to foreign key struct if index
315
is defined for foreign key, otherwise NULL */
316
dict_table_t* table, /* in: InnoDB table */
317
dict_index_t* index); /* in: InnoDB index */
318
/*************************************************************************
319
293
Scans a table create SQL string and adds to the data dictionary
320
294
the foreign key constraints declared in the string. This function
321
295
should be called after the indexes for a table have been created.
322
296
Each foreign key constraint must be accompanied with indexes in
323
297
bot participating tables. The indexes are allowed to contain more
324
298
fields than mentioned in the constraint. */
327
301
dict_create_foreign_constraints(
328
302
/*============================*/
376
350
/* in: whether to increment the open
377
351
handle count on the table */
378
352
/**************************************************************************
379
Returns a index object, based on table and index id, and memoryfixes it. */
382
dict_index_get_on_id_low(
353
Returns a table object based on table id. */
356
dict_table_get_on_id(
357
/*=================*/
358
/* out: table, NULL if does not exist */
359
dulint table_id, /* in: table id */
360
trx_t* trx); /* in: transaction handle */
361
/**************************************************************************
362
Returns a table object based on table id. */
365
dict_table_get_on_id_low(
383
366
/*=====================*/
384
/* out: index, NULL if does not
386
dict_table_t* table, /* in: table */
387
dulint index_id); /* in: index id */
367
/* out: table, NULL if does not exist */
368
dulint table_id); /* in: table id */
388
369
/**************************************************************************
389
370
Checks if a table is in the dictionary cache. */
393
373
dict_table_check_if_in_cache_low(
404
384
/* out: table, NULL if not found */
405
385
const char* table_name); /* in: table name */
406
386
/**************************************************************************
407
Returns a table object based on table id. */
387
A noninlined version of dict_table_get_low. */
390
dict_table_get_low_noninlined(
391
/*==========================*/
392
/* out: table, NULL if not found */
393
const char* table_name); /* in: table name */
394
/**************************************************************************
395
Returns an index object. */
410
dict_table_get_on_id_low(
411
/*=====================*/
412
/* out: table, NULL if does not exist */
413
dulint table_id); /* in: table id */
398
dict_table_get_index(
399
/*=================*/
400
/* out: index, NULL if does not exist */
401
dict_table_t* table, /* in: table */
402
const char* name); /* in: index name */
414
403
/**************************************************************************
415
Returns an index object by matching on the name and column names and if
416
more than index is found return the index with the higher id.*/
404
Returns an index object. */
419
dict_table_get_index_by_max_id(
407
dict_table_get_index_noninline(
420
408
/*===========================*/
421
/* out: matching index, NULL if not found */
409
/* out: index, NULL if does not exist */
422
410
dict_table_t* table, /* in: table */
423
const char* name, /* in: the index name to find */
424
const char** columns,/* in: array of column names */
425
ulint n_cols);/* in: number of columns */
411
const char* name); /* in: index name */
426
412
/**************************************************************************
427
413
Returns a column's name. */
483
468
ibool add_newline); /* in: whether to add a newline */
484
469
/************************************************************************
485
470
Displays the names of the index and the table. */
488
472
dict_index_name_print(
489
473
/*==================*/
490
474
FILE* file, /* in: output stream */
491
475
trx_t* trx, /* in: transaction */
492
476
const dict_index_t* index); /* in: index to print */
494
477
/************************************************************************
495
478
Gets the first index on the table (the clustered index). */
498
481
dict_table_get_first_index(
499
482
/*=======================*/
500
/* out: index, NULL if none exists */
501
const dict_table_t* table); /* in: table */
483
/* out: index, NULL if none exists */
484
dict_table_t* table); /* in: table */
485
/************************************************************************
486
Gets the first index on the table (the clustered index). */
489
dict_table_get_first_index_noninline(
490
/*=================================*/
491
/* out: index, NULL if none exists */
492
dict_table_t* table); /* in: table */
502
493
/************************************************************************
503
494
Gets the next index on the table. */
506
497
dict_table_get_next_index(
507
498
/*======================*/
508
/* out: index, NULL if none left */
509
const dict_index_t* index); /* in: index */
510
#else /* UNIV_DEBUG */
511
# define dict_table_get_first_index(table) UT_LIST_GET_FIRST((table)->indexes)
512
# define dict_table_get_next_index(index) UT_LIST_GET_NEXT(indexes, index)
513
#endif /* UNIV_DEBUG */
514
/************************************************************************
515
Check whether the index is the clustered index. */
520
/* out: nonzero for clustered index,
521
zero for other indexes */
522
const dict_index_t* index) /* in: index */
523
__attribute__((pure));
524
/************************************************************************
525
Check whether the index is unique. */
528
dict_index_is_unique(
529
/*=================*/
530
/* out: nonzero for unique index,
531
zero for other indexes */
532
const dict_index_t* index) /* in: index */
533
__attribute__((pure));
534
/************************************************************************
535
Check whether the index is the insert buffer tree. */
540
/* out: nonzero for insert buffer,
541
zero for other indexes */
542
const dict_index_t* index) /* in: index */
543
__attribute__((pure));
499
/* out: index, NULL if none left */
500
dict_index_t* index); /* in: index */
501
/************************************************************************
502
Gets the next index on the table. */
505
dict_table_get_next_index_noninline(
506
/*================================*/
507
/* out: index, NULL if none left */
508
dict_index_t* index); /* in: index */
545
509
/************************************************************************
546
510
Gets the number of user-defined columns in a table in the dictionary
550
514
dict_table_get_n_user_cols(
551
515
/*=======================*/
552
/* out: number of user-defined
554
columns of a table */
555
const dict_table_t* table); /* in: table */
516
/* out: number of user-defined (e.g., not
517
ROW_ID) columns of a table */
518
dict_table_t* table); /* in: table */
556
519
/************************************************************************
557
520
Gets the number of system columns in a table in the dictionary cache. */
560
523
dict_table_get_n_sys_cols(
561
524
/*======================*/
562
/* out: number of system (e.g.,
563
ROW_ID) columns of a table */
564
const dict_table_t* table); /* in: table */
525
/* out: number of system (e.g.,
526
ROW_ID) columns of a table */
527
dict_table_t* table); /* in: table */
565
528
/************************************************************************
566
529
Gets the number of all columns (also system) in a table in the dictionary
570
533
dict_table_get_n_cols(
571
534
/*==================*/
572
/* out: number of columns of a table */
573
const dict_table_t* table); /* in: table */
535
/* out: number of columns of a table */
536
dict_table_t* table); /* in: table */
575
537
/************************************************************************
576
538
Gets the nth column of a table. */
579
541
dict_table_get_nth_col(
580
542
/*===================*/
581
543
/* out: pointer to column object */
582
544
const dict_table_t* table, /* in: table */
583
545
ulint pos); /* in: position of column */
584
546
/************************************************************************
547
Gets the nth column of a table. */
550
dict_table_get_nth_col_noninline(
551
/*=============================*/
552
/* out: pointer to column object */
553
const dict_table_t* table, /* in: table */
554
ulint pos); /* in: position of column */
555
/************************************************************************
585
556
Gets the given system column of a table. */
588
559
dict_table_get_sys_col(
589
560
/*===================*/
590
561
/* out: pointer to column object */
591
562
const dict_table_t* table, /* in: table */
592
563
ulint sys); /* in: DATA_ROW_ID, ... */
593
#else /* UNIV_DEBUG */
594
#define dict_table_get_nth_col(table, pos) \
595
((table)->cols + (pos))
596
#define dict_table_get_sys_col(table, sys) \
597
((table)->cols + (table)->n_cols + (sys) - DATA_N_SYS_COLS)
598
#endif /* UNIV_DEBUG */
599
564
/************************************************************************
600
565
Gets the given system column number of a table. */
603
568
dict_table_get_sys_col_no(
604
569
/*======================*/
605
/* out: column number */
606
const dict_table_t* table, /* in: table */
607
ulint sys); /* in: DATA_ROW_ID, ... */
608
/************************************************************************
609
Returns the minimum data size of an index record. */
612
dict_index_get_min_size(
613
/*====================*/
614
/* out: minimum data size in bytes */
615
const dict_index_t* index); /* in: index */
570
/* out: column number */
571
dict_table_t* table, /* in: table */
572
ulint sys); /* in: DATA_ROW_ID, ... */
616
573
/************************************************************************
617
574
Check whether the table uses the compact page format. */
623
580
compact page format */
624
581
const dict_table_t* table); /* in: table */
625
582
/************************************************************************
626
Determine the file format of a table. */
629
dict_table_get_format(
630
/*==================*/
631
/* out: file format version */
632
const dict_table_t* table); /* in: table */
633
/************************************************************************
634
Set the file format of a table. */
637
dict_table_set_format(
638
/*==================*/
639
dict_table_t* table, /* in/out: table */
640
ulint format);/* in: file format version */
641
/************************************************************************
642
Extract the compressed page size from table flags. */
645
dict_table_flags_to_zip_size(
583
Check whether the table uses the compact page format. */
586
dict_table_is_comp_noninline(
646
587
/*=========================*/
647
/* out: compressed page size,
648
or 0 if not compressed */
649
ulint flags) /* in: flags */
650
__attribute__((__const__));
651
/************************************************************************
652
Check whether the table uses the compressed compact page format. */
657
/* out: compressed page size,
658
or 0 if not compressed */
588
/* out: TRUE if table uses the
589
compact page format */
659
590
const dict_table_t* table); /* in: table */
660
591
/************************************************************************
661
592
Checks if a column is in the ordering columns of the clustered index of a
662
593
table. Column prefixes are treated like whole columns. */
665
596
dict_table_col_in_clustered_key(
666
597
/*============================*/
667
/* out: TRUE if the column, or its
668
prefix, is in the clustered key */
669
const dict_table_t* table, /* in: table */
670
ulint n); /* in: column number */
598
/* out: TRUE if the column, or its prefix, is
599
in the clustered key */
600
dict_table_t* table, /* in: table */
601
ulint n); /* in: column number */
671
602
/***********************************************************************
672
Copies types of columns contained in table to tuple and sets all
673
fields of the tuple to the SQL NULL value. This function should
674
be called right after dtuple_create(). */
603
Copies types of columns contained in table to tuple. */
677
606
dict_table_copy_types(
678
607
/*==================*/
679
dtuple_t* tuple, /* in/out: data tuple */
680
const dict_table_t* table); /* in: table */
608
dtuple_t* tuple, /* in: data tuple */
609
dict_table_t* table); /* in: index */
681
610
/**************************************************************************
682
611
Looks for an index with the given id. NOTE that we do not reserve
683
612
the dictionary mutex: this function is for emergency purposes like
684
613
printing info of a corrupt database page! */
687
616
dict_index_find_on_id_low(
688
617
/*======================*/
690
619
dulint id); /* in: index id */
691
620
/**************************************************************************
692
621
Adds an index to the dictionary cache. */
695
624
dict_index_add_to_cache(
696
625
/*====================*/
697
/* out: DB_SUCCESS or error code */
698
626
dict_table_t* table, /* in: table on which the index is */
699
627
dict_index_t* index, /* in, own: index; NOTE! The index memory
700
628
object is freed in this function! */
701
629
ulint page_no);/* in: root page number of the index */
702
/**************************************************************************
703
Removes an index from the dictionary cache. */
706
dict_index_remove_from_cache(
707
/*=========================*/
708
dict_table_t* table, /* in/out: table */
709
dict_index_t* index); /* in, own: index */
710
630
/************************************************************************
711
631
Gets the number of fields in the internal representation of an index,
712
632
including fields added by the dictionary system. */
751
670
dict_index_get_n_ordering_defined_by_user(
752
671
/*======================================*/
753
/* out: number of fields */
754
const dict_index_t* index); /* in: an internal representation
755
of index (in the dictionary cache) */
672
/* out: number of fields */
673
dict_index_t* index); /* in: an internal representation of index
674
(in the dictionary cache) */
757
675
/************************************************************************
758
676
Gets the nth field of an index. */
761
679
dict_index_get_nth_field(
762
680
/*=====================*/
763
/* out: pointer to field object */
681
/* out: pointer to field object */
764
682
const dict_index_t* index, /* in: index */
765
ulint pos); /* in: position of field */
766
#else /* UNIV_DEBUG */
767
# define dict_index_get_nth_field(index, pos) ((index)->fields + (pos))
768
#endif /* UNIV_DEBUG */
683
ulint pos); /* in: position of field */
769
684
/************************************************************************
770
685
Gets pointer to the nth column in an index. */
786
701
ulint pos); /* in: position of the field */
787
702
/************************************************************************
788
703
Looks for column n in an index. */
791
706
dict_index_get_nth_col_pos(
792
707
/*=======================*/
793
/* out: position in internal
794
representation of the index;
795
if not contained, returns
797
const dict_index_t* index, /* in: index */
798
ulint n); /* in: column number */
708
/* out: position in internal representation
709
of the index; if not contained, returns
711
dict_index_t* index, /* in: index */
712
ulint n); /* in: column number */
799
713
/************************************************************************
800
714
Returns TRUE if the index contains a column or a prefix of that column. */
803
717
dict_index_contains_col_or_prefix(
804
718
/*==============================*/
805
/* out: TRUE if contains the column
807
const dict_index_t* index, /* in: index */
808
ulint n); /* in: column number */
719
/* out: TRUE if contains the column or its
721
dict_index_t* index, /* in: index */
722
ulint n); /* in: column number */
809
723
/************************************************************************
810
724
Looks for a matching field in an index. The column has to be the same. The
811
725
column in index must be complete, or must contain a prefix longer than the
812
726
column in index2. That is, we must be able to construct the prefix in index2
813
727
from the prefix in index. */
816
730
dict_index_get_nth_field_pos(
817
731
/*=========================*/
818
/* out: position in internal
819
representation of the index;
820
if not contained, returns
822
const dict_index_t* index, /* in: index from which to search */
823
const dict_index_t* index2, /* in: index */
824
ulint n); /* in: field number in index2 */
732
/* out: position in internal representation
733
of the index; if not contained, returns
735
dict_index_t* index, /* in: index from which to search */
736
dict_index_t* index2, /* in: index */
737
ulint n); /* in: field number in index2 */
825
738
/************************************************************************
826
739
Looks for column n position in the clustered index. */
829
742
dict_table_get_nth_col_pos(
830
743
/*=======================*/
831
/* out: position in internal
833
the clustered index */
834
const dict_table_t* table, /* in: table */
835
ulint n); /* in: column number */
744
/* out: position in internal representation
745
of the clustered index */
746
dict_table_t* table, /* in: table */
747
ulint n); /* in: column number */
836
748
/************************************************************************
837
749
Returns the position of a system column in an index. */
840
752
dict_index_get_sys_col_pos(
841
753
/*=======================*/
843
ULINT_UNDEFINED if not contained */
844
const dict_index_t* index, /* in: index */
845
ulint type); /* in: DATA_ROW_ID, ... */
754
/* out: position, ULINT_UNDEFINED if not
756
dict_index_t* index, /* in: index */
757
ulint type); /* in: DATA_ROW_ID, ... */
846
758
/***********************************************************************
847
759
Adds a column to index. */
850
762
dict_index_add_col(
851
763
/*===============*/
852
dict_index_t* index, /* in/out: index */
853
const dict_table_t* table, /* in: table */
854
dict_col_t* col, /* in: column */
855
ulint prefix_len); /* in: column prefix length */
764
dict_index_t* index, /* in: index */
765
dict_table_t* table, /* in: table */
766
dict_col_t* col, /* in: column */
767
ulint prefix_len); /* in: column prefix length */
856
768
/***********************************************************************
857
769
Copies types of fields contained in index to tuple. */
860
772
dict_index_copy_types(
861
773
/*==================*/
862
dtuple_t* tuple, /* in/out: data tuple */
863
const dict_index_t* index, /* in: index */
864
ulint n_fields); /* in: number of
865
field types to copy */
774
dtuple_t* tuple, /* in: data tuple */
775
dict_index_t* index, /* in: index */
776
ulint n_fields); /* in: number of field types to copy */
866
777
/*************************************************************************
867
778
Gets the field column. */
871
782
/*===============*/
872
783
const dict_field_t* field);
874
/**************************************************************************
875
Returns an index object if it is found in the dictionary cache.
876
Assumes that dict_sys->mutex is already being held. */
879
dict_index_get_if_in_cache_low(
880
/*===========================*/
881
/* out: index, NULL if not found */
882
dulint index_id); /* in: index id */
883
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
884
786
/**************************************************************************
885
787
Returns an index object if it is found in the dictionary cache. */
888
790
dict_index_get_if_in_cache(
889
791
/*=======================*/
890
792
/* out: index, NULL if not found */
891
793
dulint index_id); /* in: index id */
892
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
894
794
/**************************************************************************
895
795
Checks that a tuple has n_fields_cmp value in a sensible range, so that
896
796
no comparison can occur with the page number field in a node pointer. */
899
799
dict_index_check_search_tuple(
900
800
/*==========================*/
901
/* out: TRUE if ok */
902
const dict_index_t* index, /* in: index tree */
903
const dtuple_t* tuple); /* in: tuple used in a search */
904
/**************************************************************************
905
Check for duplicate index entries in a table [using the index name] */
908
dict_table_check_for_dup_indexes(
909
/*=============================*/
910
const dict_table_t* table); /* in: Check for dup indexes
801
/* out: TRUE if ok */
802
dict_index_t* index, /* in: index */
803
dtuple_t* tuple); /* in: tuple used in a search */
913
804
#endif /* UNIV_DEBUG */
914
805
/**************************************************************************
915
806
Builds a node pointer out of a physical record and a page number. */
918
809
dict_index_build_node_ptr(
919
810
/*======================*/
920
/* out, own: node pointer */
921
const dict_index_t* index, /* in: index */
922
const rec_t* rec, /* in: record for which to build node
924
ulint page_no,/* in: page number to put in node
926
mem_heap_t* heap, /* in: memory heap where pointer
928
ulint level); /* in: level of rec in tree:
929
0 means leaf level */
811
/* out, own: node pointer */
812
dict_index_t* index, /* in: index */
813
rec_t* rec, /* in: record for which to build node
815
ulint page_no,/* in: page number to put in node pointer */
816
mem_heap_t* heap, /* in: memory heap where pointer created */
817
ulint level); /* in: level of rec in tree: 0 means leaf
930
819
/**************************************************************************
931
820
Copies an initial segment of a physical record, long enough to specify an
932
821
index entry uniquely. */
935
824
dict_index_copy_rec_order_prefix(
936
825
/*=============================*/
937
/* out: pointer to the prefix record */
938
const dict_index_t* index, /* in: index */
939
const rec_t* rec, /* in: record for which to
941
ulint* n_fields,/* out: number of fields copied */
942
byte** buf, /* in/out: memory buffer for the
943
copied prefix, or NULL */
944
ulint* buf_size);/* in/out: buffer size */
826
/* out: pointer to the prefix record */
827
dict_index_t* index, /* in: index */
828
rec_t* rec, /* in: record for which to copy prefix */
829
ulint* n_fields,/* out: number of fields copied */
830
byte** buf, /* in/out: memory buffer for the copied prefix,
832
ulint* buf_size);/* in/out: buffer size */
945
833
/**************************************************************************
946
834
Builds a typed data tuple out of a physical record. */
949
837
dict_index_build_data_tuple(
950
838
/*========================*/
1013
901
reserved for updates */
1014
902
/*************************************************************************
1015
903
Calculates the minimum record length in an index. */
1018
906
dict_index_calc_min_rec_len(
1019
907
/*========================*/
1020
const dict_index_t* index); /* in: index */
908
dict_index_t* index); /* in: index */
1021
909
/*************************************************************************
1022
910
Calculates new estimates for table and index statistics. The statistics
1023
911
are used in query optimization. */
1026
914
dict_update_statistics_low(
1027
915
/*=======================*/
1028
dict_table_t* table, /* in/out: table */
916
dict_table_t* table, /* in: table */
1029
917
ibool has_dict_mutex);/* in: TRUE if the caller has the
1030
918
dictionary mutex */
1031
919
/*************************************************************************
1032
920
Calculates new estimates for table and index statistics. The statistics
1033
921
are used in query optimization. */
1036
924
dict_update_statistics(
1037
925
/*===================*/
1038
dict_table_t* table); /* in/out: table */
926
dict_table_t* table); /* in: table */
1039
927
/************************************************************************
1040
928
Reserves the dictionary system mutex for MySQL. */
1043
931
dict_mutex_enter_for_mysql(void);
1044
932
/*============================*/
1045
933
/************************************************************************
1046
934
Releases the dictionary system mutex for MySQL. */
1049
937
dict_mutex_exit_for_mysql(void);
1050
938
/*===========================*/
1051
939
/************************************************************************
1052
940
Checks if the database name in two table names is the same. */
1055
943
dict_tables_have_same_db(
1056
944
/*=====================*/
1070
958
/* out: scanned up to this */
1071
959
const char* ptr, /* in: scan from */
1072
960
const char* string);/* in: look for this */
1073
/*************************************************************************
1074
Get index by name */
1077
dict_table_get_index_on_name(
1078
/*=========================*/
1079
/* out: index, NULL if does not exist */
1080
dict_table_t* table, /* in: table */
1081
const char* name); /* in: name of the index to find */
1082
/**************************************************************************
1083
Find and index that is equivalent to the one passed in and is not marked
1087
dict_table_find_equivalent_index(
1088
/*=============================*/
1089
dict_table_t* table, /* in/out: table */
1090
dict_index_t* index); /* in: index to match */
1091
/**************************************************************************
1092
In case there is more than one index with the same name return the index
1093
with the min(id). */
1096
dict_table_get_index_on_name_and_min_id(
1097
/*====================================*/
1098
/* out: index, NULL if does not exist */
1099
dict_table_t* table, /* in: table */
1100
const char* name); /* in: name of the index to find */
1101
961
/* Buffers for storing detailed information about the latest foreign key
1102
962
and unique key errors */
1103
963
extern FILE* dict_foreign_err_file;