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 */
56
65
/************************************************************************
57
66
Decrements the count of open MySQL handles to a table. */
60
69
dict_table_decrement_handle_count(
61
70
/*==============================*/
62
dict_table_t* table); /* in: table */
71
dict_table_t* table, /* in/out: table */
72
ibool dict_locked); /* in: TRUE=data dictionary locked */
63
73
/**************************************************************************
64
74
Inits the data dictionary module. */
172
166
const char* name); /* in: column name */
173
167
/************************************************************************
174
168
Acquire the autoinc lock.*/
177
171
dict_table_autoinc_lock(
178
172
/*====================*/
179
dict_table_t* table); /* in: table */
173
dict_table_t* table); /* in/out: table */
180
174
/************************************************************************
181
175
Initializes the autoinc counter. It is not an error to initialize an already
182
176
initialized counter. */
185
179
dict_table_autoinc_initialize(
186
180
/*==========================*/
187
dict_table_t* table, /* in: table */
188
ib_longlong value); /* in: next value to assign to a row */
181
dict_table_t* table, /* in/out: table */
182
ib_uint64_t value); /* in: next value to assign to a row */
189
183
/************************************************************************
190
184
Reads the next autoinc value (== autoinc counter value), 0 if not yet
194
188
dict_table_autoinc_read(
195
189
/*====================*/
196
/* out: value for a new row, or 0 */
197
dict_table_t* table); /* in: table */
190
/* out: value for a new row, or 0 */
191
const dict_table_t* table); /* in: table */
198
192
/************************************************************************
199
193
Updates the autoinc counter if the value supplied is equal or bigger than the
200
194
current value. If not inited, does nothing. */
203
197
dict_table_autoinc_update(
204
198
/*======================*/
206
dict_table_t* table, /* in: table */
207
ib_longlong value); /* in: value which was assigned to a row */
200
dict_table_t* table, /* in/out: table */
201
ib_uint64_t value); /* in: value which was assigned to a row */
208
202
/************************************************************************
209
203
Release the autoinc lock.*/
212
206
dict_table_autoinc_unlock(
213
207
/*======================*/
214
dict_table_t* table); /* in: table */
208
dict_table_t* table); /* in/out: table */
215
209
/**************************************************************************
216
210
Adds system columns to a table object. */
219
213
dict_table_add_system_columns(
220
214
/*==========================*/
230
224
mem_heap_t* heap); /* in: temporary heap */
231
225
/**************************************************************************
232
226
Removes a table object from the dictionary cache. */
235
229
dict_table_remove_from_cache(
236
230
/*=========================*/
237
231
dict_table_t* table); /* in, own: table */
238
232
/**************************************************************************
239
233
Renames a table object. */
242
236
dict_table_rename_in_cache(
243
237
/*=======================*/
244
238
/* out: TRUE if success */
245
dict_table_t* table, /* in: table */
239
dict_table_t* table, /* in/out: table */
246
240
const char* new_name, /* in: new name */
247
241
ibool rename_also_foreigns);/* in: in ALTER TABLE we want
248
242
to preserve the original table name
270
264
ibool check_charsets);/* in: TRUE=check charset
272
266
/*************************************************************************
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
/*************************************************************************
273
278
Checks if a table is referenced by foreign keys. */
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 */
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 */
281
295
/**************************************************************************
282
296
Determines whether a string starts with the specified keyword. */
285
299
dict_str_starts_with_keyword(
286
300
/*=========================*/
290
304
const char* str, /* in: string to scan for keyword */
291
305
const char* keyword); /* in: keyword to look for */
292
306
/*************************************************************************
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
/*************************************************************************
293
319
Scans a table create SQL string and adds to the data dictionary
294
320
the foreign key constraints declared in the string. This function
295
321
should be called after the indexes for a table have been created.
296
322
Each foreign key constraint must be accompanied with indexes in
297
323
bot participating tables. The indexes are allowed to contain more
298
324
fields than mentioned in the constraint. */
301
327
dict_create_foreign_constraints(
302
328
/*============================*/
350
376
/* in: whether to increment the open
351
377
handle count on the table */
352
378
/**************************************************************************
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(
379
Returns a index object, based on table and index id, and memoryfixes it. */
382
dict_index_get_on_id_low(
366
383
/*=====================*/
367
/* out: table, NULL if does not exist */
368
dulint table_id); /* in: table id */
384
/* out: index, NULL if does not
386
dict_table_t* table, /* in: table */
387
dulint index_id); /* in: index id */
369
388
/**************************************************************************
370
389
Checks if a table is in the dictionary cache. */
373
393
dict_table_check_if_in_cache_low(
384
404
/* out: table, NULL if not found */
385
405
const char* table_name); /* in: table name */
386
406
/**************************************************************************
387
A noninlined version of dict_table_get_low. */
407
Returns a table object based on table id. */
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. */
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 */
403
/**************************************************************************
404
Returns an index object. */
407
dict_table_get_index_noninline(
410
dict_table_get_on_id_low(
411
/*=====================*/
412
/* out: table, NULL if does not exist */
413
dulint table_id); /* in: table id */
414
/**************************************************************************
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.*/
419
dict_table_get_index_by_max_id(
408
420
/*===========================*/
409
/* out: index, NULL if does not exist */
421
/* out: matching index, NULL if not found */
410
422
dict_table_t* table, /* in: table */
411
const char* name); /* in: index name */
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 */
412
426
/**************************************************************************
413
427
Returns a column's name. */
468
483
ibool add_newline); /* in: whether to add a newline */
469
484
/************************************************************************
470
485
Displays the names of the index and the table. */
472
488
dict_index_name_print(
473
489
/*==================*/
474
490
FILE* file, /* in: output stream */
475
491
trx_t* trx, /* in: transaction */
476
492
const dict_index_t* index); /* in: index to print */
477
494
/************************************************************************
478
495
Gets the first index on the table (the clustered index). */
481
498
dict_table_get_first_index(
482
499
/*=======================*/
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 */
500
/* out: index, NULL if none exists */
501
const dict_table_t* table); /* in: table */
493
502
/************************************************************************
494
503
Gets the next index on the table. */
497
506
dict_table_get_next_index(
498
507
/*======================*/
499
/* out: index, NULL if none left */
500
dict_index_t* index); /* in: index */
501
/************************************************************************
502
Gets the next index on the table. */
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));
505
dict_table_get_next_index_noninline(
506
/*================================*/
507
/* out: index, NULL if none left */
508
dict_index_t* index); /* in: index */
509
545
/************************************************************************
510
546
Gets the number of user-defined columns in a table in the dictionary
514
550
dict_table_get_n_user_cols(
515
551
/*=======================*/
516
/* out: number of user-defined (e.g., not
517
ROW_ID) columns of a table */
518
dict_table_t* table); /* in: table */
552
/* out: number of user-defined
554
columns of a table */
555
const dict_table_t* table); /* in: table */
519
556
/************************************************************************
520
557
Gets the number of system columns in a table in the dictionary cache. */
523
560
dict_table_get_n_sys_cols(
524
561
/*======================*/
525
/* out: number of system (e.g.,
526
ROW_ID) columns of a table */
527
dict_table_t* table); /* in: table */
562
/* out: number of system (e.g.,
563
ROW_ID) columns of a table */
564
const dict_table_t* table); /* in: table */
528
565
/************************************************************************
529
566
Gets the number of all columns (also system) in a table in the dictionary
533
570
dict_table_get_n_cols(
534
571
/*==================*/
535
/* out: number of columns of a table */
536
dict_table_t* table); /* in: table */
572
/* out: number of columns of a table */
573
const dict_table_t* table); /* in: table */
537
575
/************************************************************************
538
576
Gets the nth column of a table. */
541
579
dict_table_get_nth_col(
542
580
/*===================*/
543
581
/* out: pointer to column object */
544
582
const dict_table_t* table, /* in: table */
545
583
ulint pos); /* in: position of column */
546
584
/************************************************************************
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
/************************************************************************
556
585
Gets the given system column of a table. */
559
588
dict_table_get_sys_col(
560
589
/*===================*/
561
590
/* out: pointer to column object */
562
591
const dict_table_t* table, /* in: table */
563
592
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 */
564
599
/************************************************************************
565
600
Gets the given system column number of a table. */
568
603
dict_table_get_sys_col_no(
569
604
/*======================*/
570
/* out: column number */
571
dict_table_t* table, /* in: table */
572
ulint sys); /* in: DATA_ROW_ID, ... */
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 */
573
616
/************************************************************************
574
617
Check whether the table uses the compact page format. */
580
623
compact page format */
581
624
const dict_table_t* table); /* in: table */
582
625
/************************************************************************
583
Check whether the table uses the compact page format. */
586
dict_table_is_comp_noninline(
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(
587
646
/*=========================*/
588
/* out: TRUE if table uses the
589
compact page format */
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 */
590
659
const dict_table_t* table); /* in: table */
591
660
/************************************************************************
592
661
Checks if a column is in the ordering columns of the clustered index of a
593
662
table. Column prefixes are treated like whole columns. */
596
665
dict_table_col_in_clustered_key(
597
666
/*============================*/
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 */
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 */
602
671
/***********************************************************************
603
Copies types of columns contained in table to tuple. */
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(). */
606
677
dict_table_copy_types(
607
678
/*==================*/
608
dtuple_t* tuple, /* in: data tuple */
609
dict_table_t* table); /* in: index */
679
dtuple_t* tuple, /* in/out: data tuple */
680
const dict_table_t* table); /* in: table */
610
681
/**************************************************************************
611
682
Looks for an index with the given id. NOTE that we do not reserve
612
683
the dictionary mutex: this function is for emergency purposes like
613
684
printing info of a corrupt database page! */
616
687
dict_index_find_on_id_low(
617
688
/*======================*/
619
690
dulint id); /* in: index id */
620
691
/**************************************************************************
621
692
Adds an index to the dictionary cache. */
624
695
dict_index_add_to_cache(
625
696
/*====================*/
697
/* out: DB_SUCCESS or error code */
626
698
dict_table_t* table, /* in: table on which the index is */
627
699
dict_index_t* index, /* in, own: index; NOTE! The index memory
628
700
object is freed in this function! */
629
701
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 */
630
710
/************************************************************************
631
711
Gets the number of fields in the internal representation of an index,
632
712
including fields added by the dictionary system. */
670
751
dict_index_get_n_ordering_defined_by_user(
671
752
/*======================================*/
672
/* out: number of fields */
673
dict_index_t* index); /* in: an internal representation of index
674
(in the dictionary cache) */
753
/* out: number of fields */
754
const dict_index_t* index); /* in: an internal representation
755
of index (in the dictionary cache) */
675
757
/************************************************************************
676
758
Gets the nth field of an index. */
679
761
dict_index_get_nth_field(
680
762
/*=====================*/
681
/* out: pointer to field object */
763
/* out: pointer to field object */
682
764
const dict_index_t* index, /* in: index */
683
ulint pos); /* in: position of field */
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 */
684
769
/************************************************************************
685
770
Gets pointer to the nth column in an index. */
701
786
ulint pos); /* in: position of the field */
702
787
/************************************************************************
703
788
Looks for column n in an index. */
706
791
dict_index_get_nth_col_pos(
707
792
/*=======================*/
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 */
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 */
713
799
/************************************************************************
714
800
Returns TRUE if the index contains a column or a prefix of that column. */
717
803
dict_index_contains_col_or_prefix(
718
804
/*==============================*/
719
/* out: TRUE if contains the column or its
721
dict_index_t* index, /* in: index */
722
ulint n); /* in: column number */
805
/* out: TRUE if contains the column
807
const dict_index_t* index, /* in: index */
808
ulint n); /* in: column number */
723
809
/************************************************************************
724
810
Looks for a matching field in an index. The column has to be the same. The
725
811
column in index must be complete, or must contain a prefix longer than the
726
812
column in index2. That is, we must be able to construct the prefix in index2
727
813
from the prefix in index. */
730
816
dict_index_get_nth_field_pos(
731
817
/*=========================*/
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 */
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 */
738
825
/************************************************************************
739
826
Looks for column n position in the clustered index. */
742
829
dict_table_get_nth_col_pos(
743
830
/*=======================*/
744
/* out: position in internal representation
745
of the clustered index */
746
dict_table_t* table, /* in: table */
747
ulint n); /* in: column number */
831
/* out: position in internal
833
the clustered index */
834
const dict_table_t* table, /* in: table */
835
ulint n); /* in: column number */
748
836
/************************************************************************
749
837
Returns the position of a system column in an index. */
752
840
dict_index_get_sys_col_pos(
753
841
/*=======================*/
754
/* out: position, ULINT_UNDEFINED if not
756
dict_index_t* index, /* in: index */
757
ulint type); /* in: DATA_ROW_ID, ... */
843
ULINT_UNDEFINED if not contained */
844
const dict_index_t* index, /* in: index */
845
ulint type); /* in: DATA_ROW_ID, ... */
758
846
/***********************************************************************
759
847
Adds a column to index. */
762
850
dict_index_add_col(
763
851
/*===============*/
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 */
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 */
768
856
/***********************************************************************
769
857
Copies types of fields contained in index to tuple. */
772
860
dict_index_copy_types(
773
861
/*==================*/
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 */
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 */
777
866
/*************************************************************************
778
867
Gets the field column. */
782
871
/*===============*/
783
872
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
786
884
/**************************************************************************
787
885
Returns an index object if it is found in the dictionary cache. */
790
888
dict_index_get_if_in_cache(
791
889
/*=======================*/
792
890
/* out: index, NULL if not found */
793
891
dulint index_id); /* in: index id */
892
#endif /* UNIV_DEBUG || UNIV_BUF_DEBUG */
794
894
/**************************************************************************
795
895
Checks that a tuple has n_fields_cmp value in a sensible range, so that
796
896
no comparison can occur with the page number field in a node pointer. */
799
899
dict_index_check_search_tuple(
800
900
/*==========================*/
801
/* out: TRUE if ok */
802
dict_index_t* index, /* in: index */
803
dtuple_t* tuple); /* in: tuple used in a search */
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
804
913
#endif /* UNIV_DEBUG */
805
914
/**************************************************************************
806
915
Builds a node pointer out of a physical record and a page number. */
809
918
dict_index_build_node_ptr(
810
919
/*======================*/
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
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 */
819
930
/**************************************************************************
820
931
Copies an initial segment of a physical record, long enough to specify an
821
932
index entry uniquely. */
824
935
dict_index_copy_rec_order_prefix(
825
936
/*=============================*/
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 */
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 */
833
945
/**************************************************************************
834
946
Builds a typed data tuple out of a physical record. */
837
949
dict_index_build_data_tuple(
838
950
/*========================*/
901
1013
reserved for updates */
902
1014
/*************************************************************************
903
1015
Calculates the minimum record length in an index. */
906
1018
dict_index_calc_min_rec_len(
907
1019
/*========================*/
908
dict_index_t* index); /* in: index */
1020
const dict_index_t* index); /* in: index */
909
1021
/*************************************************************************
910
1022
Calculates new estimates for table and index statistics. The statistics
911
1023
are used in query optimization. */
914
1026
dict_update_statistics_low(
915
1027
/*=======================*/
916
dict_table_t* table, /* in: table */
1028
dict_table_t* table, /* in/out: table */
917
1029
ibool has_dict_mutex);/* in: TRUE if the caller has the
918
1030
dictionary mutex */
919
1031
/*************************************************************************
920
1032
Calculates new estimates for table and index statistics. The statistics
921
1033
are used in query optimization. */
924
1036
dict_update_statistics(
925
1037
/*===================*/
926
dict_table_t* table); /* in: table */
1038
dict_table_t* table); /* in/out: table */
927
1039
/************************************************************************
928
1040
Reserves the dictionary system mutex for MySQL. */
931
1043
dict_mutex_enter_for_mysql(void);
932
1044
/*============================*/
933
1045
/************************************************************************
934
1046
Releases the dictionary system mutex for MySQL. */
937
1049
dict_mutex_exit_for_mysql(void);
938
1050
/*===========================*/
939
1051
/************************************************************************
940
1052
Checks if the database name in two table names is the same. */
943
1055
dict_tables_have_same_db(
944
1056
/*=====================*/
958
1070
/* out: scanned up to this */
959
1071
const char* ptr, /* in: scan from */
960
1072
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 */
961
1101
/* Buffers for storing detailed information about the latest foreign key
962
1102
and unique key errors */
963
1103
extern FILE* dict_foreign_err_file;