41
41
if (this->type == AM_SYSTEM)
43
if ((error=this->joinReadSystem()))
43
if ((error= this->joinReadSystem()))
44
44
{ // Info for DESCRIBE
45
45
this->info="const row not found";
46
46
/* Mark for EXPLAIN that the row was not found */
154
154
this->cache.pos=pos;
157
int JoinTable::joinReadSystem()
157
int join_read_system(JoinTable *tab)
159
Table *Table= this->table;
159
Table *table= tab->table;
161
if (Table->status & STATUS_GARBAGE) // If first read
162
if (table->status & STATUS_GARBAGE) // If first read
163
if ((error=Table->cursor->read_first_row(table->getInsertRecord(),
164
Table->getShare()->getPrimaryKey())))
164
if ((error= table->cursor->read_first_row(table->getInsertRecord(),
165
table->getShare()->getPrimaryKey())))
166
167
if (error != HA_ERR_END_OF_FILE)
167
return Table->report_error(error);
168
this->table->mark_as_null_row();
169
Table->emptyRecord(); // Make empty record
169
return table->report_error(error);
172
tab->table->mark_as_null_row();
173
table->emptyRecord(); // Make empty record
172
Table->storeRecord();
174
else if (!Table->status) // Only happens with left join
175
Table->restoreRecord(); // restore old record
177
return Table->status ? -1 : 0;
176
table->storeRecord();
178
else if (table->status == 0) // Only happens with left join
180
table->restoreRecord(); // restore old record
184
return table->status ? -1 : 0;
187
int JoinTable::joinReadSystem()
189
return join_read_system(this);
180
192
} /* namespace drizzled */