~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/key.cc

  • Committer: Monty Taylor
  • Date: 2010-09-28 07:45:44 UTC
  • mto: (1799.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1800.
  • Revision ID: mordred@inaugust.com-20100928074544-s3ujnv6s8wro74l2
Added BSD copying file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
 
17
17
/* Functions to handle keys and fields in forms */
20
20
#include "drizzled/table.h"
21
21
#include "drizzled/key.h"
22
22
#include "drizzled/field/blob.h"
23
 
#include "drizzled/util/test.h"
24
 
 
25
 
#include <boost/dynamic_bitset.hpp>
26
23
 
27
24
#include <string>
28
25
 
355
352
    {
356
353
      const CHARSET_INFO * const cs= field->charset();
357
354
      field->setReadSet();
358
 
      field->val_str_internal(&tmp);
 
355
      field->val_str(&tmp);
359
356
      if (cs->mbmaxlen > 1 &&
360
357
          table->getField(key_part->fieldnr - 1)->field_length !=
361
358
          key_part->length)
375
372
      }
376
373
 
377
374
      if (key_part->length < field->pack_length())
378
 
        tmp.length(min(tmp.length(), static_cast<size_t>(key_part->length)));
 
375
        tmp.length(min(tmp.length(),(uint32_t)key_part->length));
379
376
      to->append(tmp);
380
377
    }
381
378
    else
402
399
    FALSE  Otherwise
403
400
*/
404
401
 
405
 
bool is_key_used(Table *table, uint32_t idx, const boost::dynamic_bitset<>& fields)
 
402
bool is_key_used(Table *table, uint32_t idx, const MyBitmap *fields)
406
403
{
407
 
  table->tmp_set.reset();
408
 
  table->mark_columns_used_by_index_no_reset(idx, table->tmp_set);
409
 
  if (table->tmp_set.is_subset_of(fields))
 
404
  table->tmp_set.clearAll();
 
405
  table->mark_columns_used_by_index_no_reset(idx, &table->tmp_set);
 
406
  if (bitmap_is_overlapping(&table->tmp_set, fields))
410
407
    return 1;
411
408
 
412
409
  /*