93
93
#ifdef HAVE_ALIAS_SUPPORT
94
94
{"Blob_alias", BLOB_ALIAS_LENGTH, NULL, MYSQL_TYPE_VARCHAR, &my_charset_utf8_bin, 0, "The BLOB alias"},
96
{"Repository_id", NULL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The repository file number"},
97
{"Repo_blob_offset", NULL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The offset of the BLOB in the repository file"},
98
{"Blob_size", NULL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The size of the BLOB in bytes"},
96
{"Repository_id", NOVAL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The repository file number"},
97
{"Repo_blob_offset", NOVAL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The offset of the BLOB in the repository file"},
98
{"Blob_size", NOVAL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The size of the BLOB in bytes"},
99
99
{"MD5_Checksum", 32, NULL, MYSQL_TYPE_VARCHAR, system_charset_info, 0, "The MD5 Digest of the BLOB data."},
100
{"Head_size", NULL, NULL, MYSQL_TYPE_SHORT, NULL, NOT_NULL_FLAG | UNSIGNED_FLAG, "The size of the BLOB header - proceeds the BLOB data"},
101
{"Access_code", NULL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The 4-byte authorisation code required to access the BLOB - part of the BLOB URL"},
102
{"Creation_time", NULL, NULL, MYSQL_TYPE_TIMESTAMP, NULL, NOT_NULL_FLAG, "The time the BLOB was created"},
103
{"Last_ref_time", NULL, NULL, MYSQL_TYPE_TIMESTAMP, NULL, 0, "The last time the BLOB was referenced"},
104
{"Last_access_time", NULL, NULL, MYSQL_TYPE_TIMESTAMP, NULL, 0, "The last time the BLOB was accessed (read)"},
105
{"Access_count", NULL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The count of the number of times the BLOB has been read"},
106
{NULL,NULL, NULL, MYSQL_TYPE_STRING,NULL, 0, NULL}
100
{"Head_size", NOVAL, NULL, MYSQL_TYPE_SHORT, NULL, NOT_NULL_FLAG | UNSIGNED_FLAG, "The size of the BLOB header - proceeds the BLOB data"},
101
{"Access_code", NOVAL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The 4-byte authorisation code required to access the BLOB - part of the BLOB URL"},
102
{"Creation_time", NOVAL, NULL, MYSQL_TYPE_TIMESTAMP, NULL, NOT_NULL_FLAG, "The time the BLOB was created"},
103
{"Last_ref_time", NOVAL, NULL, MYSQL_TYPE_TIMESTAMP, NULL, 0, "The last time the BLOB was referenced"},
104
{"Last_access_time", NOVAL, NULL, MYSQL_TYPE_TIMESTAMP, NULL, 0, "The last time the BLOB was accessed (read)"},
105
{"Access_count", NOVAL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The count of the number of times the BLOB has been read"},
106
{NULL,NOVAL, NULL, MYSQL_TYPE_STRING,NULL, 0, NULL}
109
109
#ifdef PBMS_HAS_KEYS
117
117
static DT_FIELD_INFO pbms_metadata_info[]=
119
{"Repository_id", NULL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The repository file number"},
120
{"Repo_blob_offset", NULL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The offset of the BLOB in the repository file"},
119
{"Repository_id", NOVAL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The repository file number"},
120
{"Repo_blob_offset", NOVAL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The offset of the BLOB in the repository file"},
121
121
{"Name", MS_META_NAME_SIZE, NULL, MYSQL_TYPE_VARCHAR, &UTF8_CHARSET, NOT_NULL_FLAG, "Metadata name"},
122
122
{"Value", MS_META_VALUE_SIZE, NULL, MYSQL_TYPE_VARCHAR, &UTF8_CHARSET, NOT_NULL_FLAG, "Metadata value"},
123
{NULL, NULL, NULL, MYSQL_TYPE_STRING, NULL, 0, NULL}
123
{NULL, NOVAL, NULL, MYSQL_TYPE_STRING, NULL, 0, NULL}
126
126
#ifdef PBMS_HAS_KEYS
135
135
#ifdef HAVE_ALIAS_SUPPORT
136
136
static DT_FIELD_INFO pbms_alias_info[]=
138
{"Repository_id", NULL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The repository file number"},
139
{"Repo_blob_offset", NULL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The offset of the BLOB in the repository file"},
138
{"Repository_id", NOVAL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The repository file number"},
139
{"Repo_blob_offset", NOVAL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The offset of the BLOB in the repository file"},
140
140
{"Blob_alias", BLOB_ALIAS_LENGTH, NULL, MYSQL_TYPE_VARCHAR, &my_charset_utf8_bin, NOT_NULL_FLAG, "The BLOB alias"},
141
{NULL,NULL, NULL, MYSQL_TYPE_STRING,NULL, 0, NULL}
141
{NULL,NOVAL, NULL, MYSQL_TYPE_STRING,NULL, 0, NULL}
144
144
static DT_KEY_INFO pbms_alias_keys[]=
151
151
static DT_FIELD_INFO pbms_blobs_info[]=
153
{"Repository_id", NULL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The repository file number"},
154
{"Repo_blob_offset", NULL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The offset of the BLOB in the repository file"},
155
{"Blob_data", NULL, NULL, MYSQL_TYPE_LONG_BLOB, &my_charset_bin, NOT_NULL_FLAG, "The data of this BLOB"},
156
{NULL,NULL, NULL, MYSQL_TYPE_STRING,NULL, 0, NULL}
153
{"Repository_id", NOVAL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The repository file number"},
154
{"Repo_blob_offset", NOVAL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The offset of the BLOB in the repository file"},
155
{"Blob_data", NOVAL, NULL, MYSQL_TYPE_LONG_BLOB, &my_charset_bin, NOT_NULL_FLAG, "The data of this BLOB"},
156
{NULL,NOVAL, NULL, MYSQL_TYPE_STRING,NULL, 0, NULL}
159
159
#ifdef PBMS_HAS_KEYS
167
167
static DT_FIELD_INFO pbms_reference_info[]=
169
169
{"Table_name", MS_TABLE_NAME_SIZE, NULL, MYSQL_TYPE_STRING, system_charset_info, 0, "The name of the referencing table"},
170
{"Column_ordinal", NULL, NULL, MYSQL_TYPE_LONG, NULL, 0, "The column ordinal of the referencing field"},
171
{"Blob_id", NULL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The BLOB reference number - part of the BLOB URL"},
170
{"Column_ordinal", NOVAL, NULL, MYSQL_TYPE_LONG, NULL, 0, "The column ordinal of the referencing field"},
171
{"Blob_id", NOVAL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The BLOB reference number - part of the BLOB URL"},
172
172
{"Blob_url", PBMS_BLOB_URL_SIZE, NULL, MYSQL_TYPE_VARCHAR, system_charset_info, 0, "The BLOB URL for HTTP GET access"},
173
{"Repository_id", NULL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The repository file number of the BLOB"},
174
{"Repo_blob_offset",NULL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The offset in the repository file"},
175
{"Blob_size", NULL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The size of the BLOB in bytes"},
176
{"Deletion_time", NULL, NULL, MYSQL_TYPE_TIMESTAMP, NULL, 0, "The time the BLOB was deleted"},
177
{"Remove_in", NULL, NULL, MYSQL_TYPE_LONG, NULL, 0, "The number of seconds before the reference/BLOB is removed perminently"},
178
{"Temp_log_id", NULL, NULL, MYSQL_TYPE_LONG, NULL, 0, "Temporary log number of the referencing deletion entry"},
179
{"Temp_log_offset", NULL, NULL, MYSQL_TYPE_LONGLONG, NULL, 0, "Temporary log offset of the referencing deletion entry"},
180
{NULL,NULL, NULL, MYSQL_TYPE_STRING,NULL, 0, NULL}
173
{"Repository_id", NOVAL, NULL, MYSQL_TYPE_LONG, NULL, NOT_NULL_FLAG, "The repository file number of the BLOB"},
174
{"Repo_blob_offset",NOVAL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The offset in the repository file"},
175
{"Blob_size", NOVAL, NULL, MYSQL_TYPE_LONGLONG, NULL, NOT_NULL_FLAG, "The size of the BLOB in bytes"},
176
{"Deletion_time", NOVAL, NULL, MYSQL_TYPE_TIMESTAMP, NULL, 0, "The time the BLOB was deleted"},
177
{"Remove_in", NOVAL, NULL, MYSQL_TYPE_LONG, NULL, 0, "The number of seconds before the reference/BLOB is removed perminently"},
178
{"Temp_log_id", NOVAL, NULL, MYSQL_TYPE_LONG, NULL, 0, "Temporary log number of the referencing deletion entry"},
179
{"Temp_log_offset", NOVAL, NULL, MYSQL_TYPE_LONGLONG, NULL, 0, "Temporary log offset of the referencing deletion entry"},
180
{NULL,NOVAL, NULL, MYSQL_TYPE_STRING,NULL, 0, NULL}
183
183
#ifdef PBMS_HAS_KEYS
491
491
//----------------
492
bool PBMSSystemTables::try_loadSystemTables(CSThread *self, int i, MSDatabase *db)
494
volatile bool rtc = true;
498
MSHTTPHeaderTable::loadTable(RETAIN(db));
501
MSCloudTable::loadTable(RETAIN(db));
504
MSBackupTable::loadTable(RETAIN(db));
507
// Variable must be loaded after cloud and backup info
508
// incase BLOB recovery is required.
509
MSVariableTable::loadTable(RETAIN(db));
492
522
void PBMSSystemTables::loadSystemTables(MSDatabase *db)
500
for ( i = 0; i < 4; i++) {
504
MSHTTPHeaderTable::loadTable(RETAIN(db));
507
MSCloudTable::loadTable(RETAIN(db));
510
MSBackupTable::loadTable(RETAIN(db));
513
// Variable must be loaded after cloud and backup info
514
// incase BLOB recovery is required.
515
MSVariableTable::loadTable(RETAIN(db));
523
self->logException();
527
for ( int i = 0; i < 4; i++) {
528
if (try_loadSystemTables(self, i, db))
529
self->logException();