Lines Matching refs:table
48 * Constructor: Create new table using scheme defintion supplied.
49 * (Make copy of scheme and keep it with table.)
62 /* Constructor: Create empty table (no scheme, no table or indices). */
66 table = NULL;
83 * Initialize table using information given in scheme 'how'.
85 * create the required number of indices; and create table for storing
117 table = new db_table();
118 if (table == NULL) {
124 FATAL("db_mindex::init: could not allocate space for table",
139 /* Add sanity check in case of table corruption */
145 if (table) table->reset();
179 * and if we're mapping for this table.
182 (table->mapping.fromLDAP ||
183 table->mapping.objType != NIS_TABLE_OBJ));
189 if (fromLDAP && table->mapping.matchFetch == mat_always) {
192 READLOCKNR(table, lockcode,
193 "r db_mindex::satisfy_query table");
201 READUNLOCKNR(table, lockcode,
202 "ru db_mindex::satisfy_query table");
228 if (table->mapping.matchFetch != mat_never) {
275 /* Add sanity check in case table corrupted */
277 WARNING("db_mindex::satisfy_query: table has no indices");
287 table, checkExpire);
323 READLOCK2(table, NULL, "r table db_mindex::prepare_results", this);
328 READUNLOCK2(this, table, NULL, NULL,
330 "ru table db_mindex::prepare_results: could not allocate space");
345 new_entry(table->get_entry(res->getlocation()));
349 READUNLOCK2(this, table, entries, entries,
359 * with information on the schema definition of this table, will determine
370 ret = extract_index_values_from_object(table->get_entry(recnum));
422 * Returns the first entry found in the table by setting 'answer' to
432 * table->first_entry() returns a pointer into the table, so
433 * we must keep the table read locked until we've copied the
435 * lock the db_mindex (this) before the db_table (table).
438 READLOCK2(table, DB_LOCK_ERROR, "r table db_mindex::first", this);
439 if (table->mapping.fromLDAP) {
442 if (now.tv_sec >= table->mapping.enumExpire) {
445 table->mapping.enumExpire = now.tv_sec +
446 table->mapping.ttl;
448 READUNLOCK2(this, table,
451 "ru table db_mindex::first LDAP");
456 entry_object_p ptr = table->first_entry(where);
461 READUNLOCK2(this, table, ret, ret,
462 "ru db_mindex::first", "ru table db_mindex::first");
467 * Returns the next entry in the table after 'previous' by setting 'answer' to
478 READLOCK2(table, DB_LOCK_ERROR, "r db_mindex::next", this);
479 if (!(table->entry_exists_p(previous)))
482 entry_object * ptr = table->next_entry(previous, where);
488 READUNLOCK2(this, table, ret, ret,
489 "ru db_mindex::next", "ru table db_mindex::next");
550 READLOCK2(table, DB_LOCK_ERROR, "r table db_mindex::first", this);
564 entry_object_p ptr = table->get_entry((*where)->location);
570 READUNLOCK2(this, table, ret, ret,
571 "ru db_mindex::first", "ru table db_mindex::first");
576 * Returns the next entry in the table after 'previous' by setting 'answer' to
587 READLOCK2(table, DB_LOCK_ERROR, "r table db_mindex::next", this);
600 table->get_entry((*where)->location);
609 READUNLOCK2(this, table, ret, ret,
610 "ru db_mindex::next", "ru table db_mindex::next");
643 * Return all entries within table. Returns the answer by
658 if (table == NULL) {
664 /* Read lock 'table' while we're traversing it */
665 READLOCKNR(table, lret, "r table db_mindex::all");
671 if (table->mapping.fromLDAP) {
674 if (now.tv_sec >= table->mapping.enumExpire) {
677 READUNLOCKNR(table, lret,
678 "ru table db_mindex::all LDAP");
686 if ((how_many = table->fullness()) <= 0) {
693 READUNLOCKNR(table, lret, "ru table db_mindex::all");
700 READUNLOCKNR(table, lret, "ru table db_mindex::all");
708 ptr = table->first_entry(&where);
716 ptr = table->next_entry(where, &where);
726 READUNLOCKNR(table, lret, "ru table db_mindex::all");
736 * 2. table where entry is stored.
763 entry_object *e = table->get_entry(recloc);
786 if (table->mapping.storeErrorDisp == abandon)
797 /* Add sanity check in case of corrupted table */
808 /* update table where record is stored */
809 table->delete_entry(recloc);
821 * Removes the entry in the table named by given query 'q'.
822 * If a NULL query is supplied, all entries in table are removed.
826 * table. If more than one entry satisfying 'q' is found, all are removed.
837 WRITELOCK2(table, DB_LOCK_ERROR, "w table db_mindex::remove", this);
838 if (q == NULL) { /* remove all entries in table */
839 if (table->mapping.toLDAP && !noWriteThrough.flag) {
846 if (table != NULL && table->getsize() > 0) {
848 WRITEUNLOCK2(table, this, DB_SUCCESS, DB_SUCCESS,
849 "wu table db_mindex::remove",
853 WRITEUNLOCK2(table, this, DB_NOTFOUND, DB_NOTFOUND,
854 "wu table db_mindex::remove",
863 WRITEUNLOCK2(table, this, DB_BADQUERY, DB_BADQUERY,
864 "wu table db_mindex::remove", "wu db_mindex::remove");
869 WRITEUNLOCK2(table, this, DB_NOTFOUND, DB_NOTFOUND,
870 "wu table db_mindex::remove", "wu db_mindex::remove");
877 WRITEUNLOCK2(table, this, s, s,
878 "wu table db_mindex::remove", "wu db_mindex::remove");
887 WRITEUNLOCK2(table, this, DB_INTERNAL_ERROR,
889 "wu table db_mindex::remove",
897 WRITEUNLOCK2(table, this, rstat, rstat,
898 "wu table db_mindex::remove",
904 WRITEUNLOCK2(table, this, DB_SUCCESS, DB_SUCCESS,
905 "wu table db_mindex::remove", "wu db_mindex::remove");
911 * Add copy of given entry to table. Entry is identified by query 'q'.
914 * and the table.
934 WRITELOCK2(table, DB_LOCK_ERROR, "w table db_mindex::add", this);
938 WRITEUNLOCK2(this, table, DB_LOCK_ERROR, DB_LOCK_ERROR,
940 "wu table db_mindex::add");
947 WRITEUNLOCK2(this, table, rstat, rstat,
949 "wu table db_mindex::add");
956 /* add object to table */
957 entryp recloc = table->add_entry(obj, initialLoad.flag);
961 table->delete_entry(recloc);
962 WRITEUNLOCK2(this, table,
965 "wu table db_mindex::add DB_MEMORY_LIMIT");
970 table->delete_entry(recloc);
974 WRITEUNLOCK2(this, table,
977 "wu table db_mindex::add DB_INTERNAL_ERROR");
1004 if (table->mapping.storeErrorDisp == abandon) {
1005 WRITEUNLOCK2(this, table,
1009 "wu table db_mindex::add LDAP");
1023 WRITEUNLOCK2(this, table, rstat, rstat,
1025 "wu table db_mindex::add");
1053 /* Write this structure (table, indices, scheme) into the specified file. */
1067 * Reset the table by: deleting all the indices, table of entries, and its
1074 reset_tables(); /* clear table contents first */
1080 if (table) { delete table; table = NULL; }
1092 * Initialize table using information from specified file.
1093 * The table is first 'reset', then the attempt to load from the file
1094 * is made. If the load failed, the table is again reset.
1095 * Therefore, the table will be modified regardless of the success of the
1104 int init_table = (this->table == NULL);
1134 * If the 'table' field was NULL before the load, but not now,
1135 * initialize the table locking and mapping.
1137 if (status == 0 && this->table != 0 && init_table) {
1144 (void) memcpy(tmptable, this->table,
1145 this->table->oldstructsize());
1146 free(this->table);
1147 this->table = tmptable;
1184 * Prints statistics of the table. This includes the size of the table,
1191 long *stats = table->stats(TRUE);
1205 /* Add sanity check in case of corrupted table */
1213 printf("index table size = %d\ncount = %d\n", size, count);
1217 /* Prints statistics about all indices of table. */
1224 /* Add sanity check in case of corrupted table */