~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

Added code necessary for building plugins dynamically.
Merged in changes from lifeless to allow autoreconf to work.
Touching plugin.ini files now triggers a rebuid - so config/autorun.sh is no
longer required to be run after touching those.
Removed the duplicate plugin names - also removed the issue that getting them
different would silently fail weirdly later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
  {
137
137
    my_errno= directory.getError();
138
138
    my_error(ER_CANT_READ_DIR, MYF(0), path, my_errno);
139
 
    return(true);
 
139
 
 
140
    return true;
140
141
  }
141
142
 
142
143
  CachedDirectory::Entries entries= directory.getEntries();
185
186
    ++entry_iter;
186
187
  }
187
188
 
188
 
  return(false);
 
189
  return false;
189
190
}
190
191
 
191
192
 
649
650
      packet->append(STRING_WITH_LEN(" ROW_FORMAT="));
650
651
      packet->append(ha_row_type[(uint32_t) create_info.row_type]);
651
652
    }
652
 
    if (table->s->key_block_size)
 
653
    if (table->s->hasKeyBlockSize())
653
654
    {
654
655
      packet->append(STRING_WITH_LEN(" KEY_BLOCK_SIZE="));
655
 
      buff= to_string(table->s->key_block_size);
 
656
      buff= to_string(table->s->getKeyBlockSize());
656
657
      packet->append(buff.c_str(), buff.length());
657
658
    }
658
659
    if (share->block_size)
684
685
    packet->append(STRING_WITH_LEN(" USING HASH"));
685
686
 
686
687
  if ((key_info->flags & HA_USES_BLOCK_SIZE) &&
687
 
      table->s->key_block_size != key_info->block_size)
 
688
      table->s->getKeyBlockSize() != key_info->block_size)
688
689
  {
689
690
    packet->append(STRING_WITH_LEN(" KEY_BLOCK_SIZE="));
690
691
    end= int64_t10_to_str(key_info->block_size, buff, 10);
1460
1461
*/
1461
1462
 
1462
1463
static int
1463
 
make_table_name_list(Session *session, vector<LEX_STRING*> &table_names, LEX *lex,
 
1464
make_table_name_list(Session *session, vector<LEX_STRING*> &table_names,
1464
1465
                     LOOKUP_FIELD_VALUES *lookup_field_vals,
1465
1466
                     bool with_i_schema, LEX_STRING *db_name)
1466
1467
{
1467
1468
  char path[FN_REFLEN];
 
1469
  set<string> set_of_names;
1468
1470
 
1469
1471
  build_table_filename(path, sizeof(path), db_name->str, "", false);
 
1472
 
1470
1473
  if (!lookup_field_vals->wild_table_value &&
1471
1474
      lookup_field_vals->table_value.str)
1472
1475
  {
1484
1487
    return 0;
1485
1488
  }
1486
1489
 
1487
 
  /*
1488
 
    This call will add all matching the wildcards (if specified) IS tables
1489
 
    to the list
1490
 
  */
1491
 
  if (with_i_schema)
1492
 
    return plugin::InfoSchemaTable::addTableToList(session, table_names,
1493
 
                                      lookup_field_vals->table_value.str);
1494
 
 
1495
1490
  string db(db_name->str);
1496
 
 
1497
 
  plugin::TableNameIterator tniter(db);
1498
 
  int err= 0;
1499
 
  string table_name;
1500
 
 
1501
 
  do {
1502
 
    err= tniter.next(&table_name);
1503
 
 
1504
 
    if (err == 0)
1505
 
    {
1506
 
      LEX_STRING *file_name= NULL;
1507
 
      file_name= session->make_lex_string(file_name, table_name.c_str(),
1508
 
                                          table_name.length(), true);
1509
 
      const char* wild= lookup_field_vals->table_value.str;
1510
 
      if (wild && wild_compare(table_name.c_str(), wild, 0))
1511
 
        continue;
1512
 
      table_names.push_back(file_name);
1513
 
    }
1514
 
 
1515
 
  } while (err == 0);
1516
 
 
1517
 
  if (err > 0)
 
1491
  plugin::StorageEngine::getTableNames(db, set_of_names);
 
1492
 
 
1493
  /*  
 
1494
    New I_S engine will make this go away, so ignore lack of foreach() usage.
 
1495
 
 
1496
    Notice how bad this design is... sure we created a set... but then we
 
1497
    are just pushing to another set. --
 
1498
    Also... callback design won't work, so we need to rewrite this to
 
1499
    feed (which means new I_S). For the moment we will not optimize this.
 
1500
 
 
1501
  */
 
1502
  for (set<string>::iterator it= set_of_names.begin(); it != set_of_names.end(); it++)
1518
1503
  {
1519
 
    /* who knows what this error condition really does...
1520
 
       anyway, we're keeping behaviour from days of yore */
1521
 
    if (lex->sql_command != SQLCOM_SELECT)
1522
 
      return 1;
1523
 
    session->clear_error();
1524
 
    return 2;
 
1504
    LEX_STRING *file_name= NULL;
 
1505
    
 
1506
    file_name= session->make_lex_string(file_name, (*it).c_str(),
 
1507
                                        (*it).length(), true);
 
1508
    const char* wild= lookup_field_vals->table_value.str;
 
1509
    if (wild && wild_compare((*it).c_str(), wild, 0))
 
1510
      continue;
 
1511
 
 
1512
    table_names.push_back(file_name);
1525
1513
  }
1526
1514
 
1527
1515
  return 0;
1855
1843
  {
1856
1844
    session->no_warnings_for_error= 1;
1857
1845
    table_names.clear();
1858
 
    int res= make_table_name_list(session, table_names, lex,
 
1846
    int res= make_table_name_list(session, table_names,
1859
1847
                                  &lookup_field_vals,
1860
1848
                                  with_i_schema, *db_name);
1861
1849