Merge lp:~stewart/drizzle/remove-unused-row-type-in-table-message into lp:~drizzle-trunk/drizzle/development

Proposed by Stewart Smith
Status: Superseded
Proposed branch: lp:~stewart/drizzle/remove-unused-row-type-in-table-message
Merge into: lp:~drizzle-trunk/drizzle/development
Prerequisite: lp:~stewart/drizzle/default-collation-in-table-message
Diff against target: 597 lines (+125/-171)
21 files modified
drizzled/cursor.h (+0/-6)
drizzled/enum.h (+0/-12)
drizzled/handler_structs.h (+0/-1)
drizzled/message/statement_transform.cc (+0/-8)
drizzled/message/table.proto (+0/-12)
drizzled/show.cc (+1/-8)
drizzled/sql_table.cc (+1/-4)
drizzled/sql_yacc.yy (+0/-2)
drizzled/statement/alter_table.cc (+0/-11)
drizzled/statement/create_index.cc (+0/-2)
drizzled/statement/drop_index.cc (+0/-1)
drizzled/table_share.cc (+0/-7)
drizzled/table_share.h (+0/-1)
plugin/archive/ha_archive.h (+1/-4)
plugin/heap/ha_heap.cc (+1/-10)
plugin/heap/ha_heap.h (+1/-1)
plugin/innobase/handler/ha_innodb.cc (+0/-37)
plugin/innobase/handler/ha_innodb.h (+0/-6)
plugin/pbms/src/pbmslib.h (+119/-0)
plugin/schema_dictionary/tables.cc (+1/-37)
plugin/schema_dictionary/tables.h (+0/-1)
To merge this branch: bzr merge lp:~stewart/drizzle/remove-unused-row-type-in-table-message
Reviewer Review Type Date Requested Status
Brian Aker Needs Fixing
Review via email: mp+28694@code.launchpad.net

Description of the change

http://hudson.drizzle.org/view/Drizzle-param/job/drizzle-param/309/

The explicit row_type entry was not being used. Everything has moved to ROW_FORMAT as an engine option.

Also see https://bugs.launchpad.net/drizzle/+bug/599605 for a bug discovered
while creating this patch.

To post a comment you must log in.
Revision history for this message
Brian Aker (brianaker) wrote :

Hi!

The collation should be explicitly expressed in the replication stream (we go for explicit over implicit).

Cheers,
  -Brian

Revision history for this message
Brian Aker (brianaker) :
review: Needs Fixing
Revision history for this message
Stewart Smith (stewart) wrote :

perhaps a SQL dialect that has everything explicit?

I'd prefer to do this a bit later as I'm mostly focused on minimal changes to get SHOW CREATE working (and the foreign key information in) and don't want to change too much at once.

(this comment is probably on the wrong branch too)

1641. By Stewart Smith

Merged default-collation-in-table-message into remove-unused-row-type-in-table-message.

1642. By Stewart Smith

merge trunk

1643. By Stewart Smith

Merged default-collation-in-table-message into remove-unused-row-type-in-table-message.

1644. By Stewart Smith

merge trunk

1645. By Stewart Smith

merge trunk

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'drizzled/cursor.h'
--- drizzled/cursor.h 2010-07-16 04:20:32 +0000
+++ drizzled/cursor.h 2010-07-27 23:22:44 +0000
@@ -320,12 +320,6 @@
320 virtual ha_rows estimate_rows_upper_bound()320 virtual ha_rows estimate_rows_upper_bound()
321 { return stats.records+EXTRA_RECORDS; }321 { return stats.records+EXTRA_RECORDS; }
322322
323 /**
324 Get the row type from the storage engine. If this method returns
325 ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used.
326 */
327 virtual enum row_type get_row_type() const { return ROW_TYPE_NOT_USED; }
328
329 virtual const char *index_type(uint32_t)323 virtual const char *index_type(uint32_t)
330 { assert(0); return "";}324 { assert(0); return "";}
331325
332326
=== modified file 'drizzled/enum.h'
--- drizzled/enum.h 2010-06-24 05:34:43 +0000
+++ drizzled/enum.h 2010-07-27 23:22:44 +0000
@@ -107,18 +107,6 @@
107 OPT_GLOBAL107 OPT_GLOBAL
108};108};
109109
110enum row_type
111{
112 ROW_TYPE_NOT_USED=-1,
113 ROW_TYPE_DEFAULT,
114 ROW_TYPE_FIXED,
115 ROW_TYPE_DYNAMIC,
116 ROW_TYPE_COMPRESSED,
117 ROW_TYPE_REDUNDANT,
118 ROW_TYPE_COMPACT,
119 ROW_TYPE_PAGE
120};
121
122enum column_format_type110enum column_format_type
123{111{
124 COLUMN_FORMAT_TYPE_NOT_USED= -1,112 COLUMN_FORMAT_TYPE_NOT_USED= -1,
125113
=== modified file 'drizzled/handler_structs.h'
--- drizzled/handler_structs.h 2010-05-15 01:19:45 +0000
+++ drizzled/handler_structs.h 2010-07-27 23:22:44 +0000
@@ -55,7 +55,6 @@
55 uint64_t auto_increment_value;55 uint64_t auto_increment_value;
56 uint32_t table_options;56 uint32_t table_options;
57 uint32_t used_fields;57 uint32_t used_fields;
58 enum row_type row_type;
59 plugin::StorageEngine *db_type;58 plugin::StorageEngine *db_type;
60 bool table_existed; /* 1 in create if table existed */59 bool table_existed; /* 1 in create if table existed */
61} HA_CREATE_INFO;60} HA_CREATE_INFO;
6261
=== modified file 'drizzled/message/statement_transform.cc'
--- drizzled/message/statement_transform.cc 2010-05-13 00:24:20 +0000
+++ drizzled/message/statement_transform.cc 2010-07-27 23:22:44 +0000
@@ -932,14 +932,6 @@
932 destination.append(ss.str());932 destination.append(ss.str());
933 ss.clear();933 ss.clear();
934 }934 }
935
936 if (options.has_row_type())
937 {
938 ss << options.row_type();
939 destination.append("\nROW_TYPE = ", 12);
940 destination.append(ss.str());
941 ss.clear();
942 }
943935
944 if (options.has_data_file_name())936 if (options.has_data_file_name())
945 {937 {
946938
=== modified file 'drizzled/message/table.proto'
--- drizzled/message/table.proto 2010-07-19 23:43:11 +0000
+++ drizzled/message/table.proto 2010-07-27 23:22:44 +0000
@@ -31,18 +31,6 @@
31 optional bool checksum = 17;31 optional bool checksum = 17;
32 optional bool page_checksum = 18;32 optional bool page_checksum = 18;
33 optional bool delay_key_write = 19;33 optional bool delay_key_write = 19;
34
35 enum RowType {
36 ROW_TYPE_DEFAULT = 0;
37 ROW_TYPE_FIXED = 1;
38 ROW_TYPE_DYNAMIC = 2;
39 ROW_TYPE_COMPRESSED = 3;
40 ROW_TYPE_REDUNDANT = 4;
41 ROW_TYPE_COMPACT = 5;
42 ROW_TYPE_PAGE = 6;
43 }
44
45 optional RowType row_type = 20;
46 }34 }
4735
48 message ForeignKeyConstraint {36 message ForeignKeyConstraint {
4937
=== modified file 'drizzled/show.cc'
--- drizzled/show.cc 2010-07-19 20:29:33 +0000
+++ drizzled/show.cc 2010-07-27 23:22:44 +0000
@@ -471,7 +471,7 @@
471471
472 key_info= table->key_info;472 key_info= table->key_info;
473 memset(&create_info, 0, sizeof(create_info));473 memset(&create_info, 0, sizeof(create_info));
474 create_info.row_type= table->getShare()->row_type;474
475 primary_key= table->getShare()->getPrimaryKey();475 primary_key= table->getShare()->getPrimaryKey();
476476
477 for (uint32_t i=0 ; i < table->getShare()->sizeKeys() ; i++,key_info++)477 for (uint32_t i=0 ; i < table->getShare()->sizeKeys() ; i++,key_info++)
@@ -558,13 +558,6 @@
558 append_unescaped(packet, option.state().c_str(), option.state().length());558 append_unescaped(packet, option.state().c_str(), option.state().length());
559 }559 }
560560
561#if 0
562 if (create_info.row_type != ROW_TYPE_DEFAULT)
563 {
564 packet->append(STRING_WITH_LEN(" ROW_FORMAT="));
565 packet->append(ha_row_type[(uint32_t) create_info.row_type]);
566 }
567#endif
568 if (table->getShare()->block_size)561 if (table->getShare()->block_size)
569 {562 {
570 packet->append(STRING_WITH_LEN(" BLOCK_SIZE="));563 packet->append(STRING_WITH_LEN(" BLOCK_SIZE="));
571564
=== modified file 'drizzled/sql_table.cc'
--- drizzled/sql_table.cc 2010-07-15 23:18:11 +0000
+++ drizzled/sql_table.cc 2010-07-27 23:22:44 +0000
@@ -810,7 +810,7 @@
810 /** @todo Get rid of this MyISAM-specific crap. */810 /** @todo Get rid of this MyISAM-specific crap. */
811 if (not create_proto.engine().name().compare("MyISAM") &&811 if (not create_proto.engine().name().compare("MyISAM") &&
812 ((sql_field->flags & BLOB_FLAG) ||812 ((sql_field->flags & BLOB_FLAG) ||
813 (sql_field->sql_type == DRIZZLE_TYPE_VARCHAR && create_info->row_type != ROW_TYPE_FIXED)))813 (sql_field->sql_type == DRIZZLE_TYPE_VARCHAR)))
814 (*db_options)|= HA_OPTION_PACK_RECORD;814 (*db_options)|= HA_OPTION_PACK_RECORD;
815 it2.rewind();815 it2.rewind();
816 }816 }
@@ -1466,9 +1466,6 @@
1466 assert(identifier.getTableName() == table_proto.name());1466 assert(identifier.getTableName() == table_proto.name());
1467 db_options= create_info->table_options;1467 db_options= create_info->table_options;
14681468
1469 if (create_info->row_type == ROW_TYPE_DYNAMIC)
1470 db_options|=HA_OPTION_PACK_RECORD;
1471
1472 set_table_default_charset(create_info, identifier.getSchemaName().c_str());1469 set_table_default_charset(create_info, identifier.getSchemaName().c_str());
14731470
1474 /* Build a Table object to pass down to the engine, and the do the actual create. */1471 /* Build a Table object to pass down to the engine, and the do the actual create. */
14751472
=== modified file 'drizzled/sql_yacc.yy'
--- drizzled/sql_yacc.yy 2010-07-08 18:02:05 +0000
+++ drizzled/sql_yacc.yy 2010-07-27 23:22:44 +0000
@@ -358,7 +358,6 @@
358 enum drizzled::sql_var_t var_type;358 enum drizzled::sql_var_t var_type;
359 drizzled::Key::Keytype key_type;359 drizzled::Key::Keytype key_type;
360 enum drizzled::ha_key_alg key_alg;360 enum drizzled::ha_key_alg key_alg;
361 enum drizzled::row_type row_type;
362 enum drizzled::column_format_type column_format_type;361 enum drizzled::column_format_type column_format_type;
363 enum drizzled::ha_rkey_function ha_rkey_mode;362 enum drizzled::ha_rkey_function ha_rkey_mode;
364 enum drizzled::enum_tx_isolation tx_isolation;363 enum drizzled::enum_tx_isolation tx_isolation;
@@ -2124,7 +2123,6 @@
2124 lex->select_lex.init_order();2123 lex->select_lex.init_order();
2125 lex->select_lex.db=2124 lex->select_lex.db=
2126 ((TableList*) lex->select_lex.table_list.first)->db;2125 ((TableList*) lex->select_lex.table_list.first)->db;
2127 statement->create_info.row_type= ROW_TYPE_NOT_USED;
2128 statement->alter_info.build_method= $2;2126 statement->alter_info.build_method= $2;
2129 }2127 }
2130 alter_commands2128 alter_commands
21312129
=== modified file 'drizzled/statement/alter_table.cc'
--- drizzled/statement/alter_table.cc 2010-06-22 20:45:28 +0000
+++ drizzled/statement/alter_table.cc 2010-07-27 23:22:44 +0000
@@ -823,8 +823,6 @@
823 ha_rows copied= 0;823 ha_rows copied= 0;
824 ha_rows deleted= 0;824 ha_rows deleted= 0;
825825
826 message::Table *original_table_definition= table->getMutableShare()->getTableProto();
827
828 session->set_proc_info("init");826 session->set_proc_info("init");
829827
830 table->use_all_columns();828 table->use_all_columns();
@@ -865,15 +863,6 @@
865 return true;863 return true;
866 }864 }
867865
868 if (create_info->row_type == ROW_TYPE_NOT_USED)
869 {
870 message::Table::TableOptions *table_options;
871 table_options= create_proto.mutable_options();
872
873 create_info->row_type= table->getShare()->row_type;
874 table_options->set_row_type(original_table_definition->options().row_type());
875 }
876
877 session->set_proc_info("setup");866 session->set_proc_info("setup");
878867
879 /*868 /*
880869
=== modified file 'drizzled/statement/create_index.cc'
--- drizzled/statement/create_index.cc 2010-05-28 01:36:09 +0000
+++ drizzled/statement/create_index.cc 2010-07-27 23:22:44 +0000
@@ -59,8 +59,6 @@
59 return true;59 return true;
60 }60 }
6161
62 create_info.row_type= ROW_TYPE_NOT_USED;
63
64 bool res;62 bool res;
65 if (original_table_message.type() == message::Table::STANDARD )63 if (original_table_message.type() == message::Table::STANDARD )
66 {64 {
6765
=== modified file 'drizzled/statement/drop_index.cc'
--- drizzled/statement/drop_index.cc 2010-05-12 21:58:06 +0000
+++ drizzled/statement/drop_index.cc 2010-07-27 23:22:44 +0000
@@ -63,7 +63,6 @@
6363
64 memset(&create_info, 0, sizeof(create_info));64 memset(&create_info, 0, sizeof(create_info));
65 create_info.db_type= 0;65 create_info.db_type= 0;
66 create_info.row_type= ROW_TYPE_NOT_USED;
6766
68 bool res;67 bool res;
69 if (original_table_message.type() == message::Table::STANDARD )68 if (original_table_message.type() == message::Table::STANDARD )
7069
=== modified file 'drizzled/table_share.cc'
--- drizzled/table_share.cc 2010-07-20 00:27:58 +0000
+++ drizzled/table_share.cc 2010-07-27 23:22:44 +0000
@@ -471,7 +471,6 @@
471 timestamp_offset(0),471 timestamp_offset(0),
472 reclength(0),472 reclength(0),
473 stored_rec_length(0),473 stored_rec_length(0),
474 row_type(ROW_TYPE_DEFAULT),
475 max_rows(0),474 max_rows(0),
476 table_proto(NULL),475 table_proto(NULL),
477 storage_engine(NULL),476 storage_engine(NULL),
@@ -544,7 +543,6 @@
544 timestamp_offset(0),543 timestamp_offset(0),
545 reclength(0),544 reclength(0),
546 stored_rec_length(0),545 stored_rec_length(0),
547 row_type(ROW_TYPE_DEFAULT),
548 max_rows(0),546 max_rows(0),
549 table_proto(NULL),547 table_proto(NULL),
550 storage_engine(NULL),548 storage_engine(NULL),
@@ -625,7 +623,6 @@
625 timestamp_offset(0),623 timestamp_offset(0),
626 reclength(0),624 reclength(0),
627 stored_rec_length(0),625 stored_rec_length(0),
628 row_type(ROW_TYPE_DEFAULT),
629 max_rows(0),626 max_rows(0),
630 table_proto(NULL),627 table_proto(NULL),
631 storage_engine(NULL),628 storage_engine(NULL),
@@ -713,7 +710,6 @@
713 timestamp_offset(0),710 timestamp_offset(0),
714 reclength(0),711 reclength(0),
715 stored_rec_length(0),712 stored_rec_length(0),
716 row_type(ROW_TYPE_DEFAULT),
717 max_rows(0),713 max_rows(0),
718 table_proto(NULL),714 table_proto(NULL),
719 storage_engine(NULL),715 storage_engine(NULL),
@@ -903,9 +899,6 @@
903 db_create_options= (local_db_create_options & 0x0000FFFF);899 db_create_options= (local_db_create_options & 0x0000FFFF);
904 db_options_in_use= db_create_options;900 db_options_in_use= db_create_options;
905901
906 row_type= table_options.has_row_type() ?
907 (enum row_type) table_options.row_type() : ROW_TYPE_DEFAULT;
908
909 block_size= table_options.has_block_size() ?902 block_size= table_options.has_block_size() ?
910 table_options.block_size() : 0;903 table_options.block_size() : 0;
911904
912905
=== modified file 'drizzled/table_share.h'
--- drizzled/table_share.h 2010-06-29 13:47:17 +0000
+++ drizzled/table_share.h 2010-07-27 23:22:44 +0000
@@ -340,7 +340,6 @@
340 uint32_t reclength; /* Recordlength */340 uint32_t reclength; /* Recordlength */
341public:341public:
342 uint32_t stored_rec_length; /* Stored record length*/342 uint32_t stored_rec_length; /* Stored record length*/
343 enum row_type row_type; /* How rows are stored */
344343
345 uint32_t getRecordLength() const344 uint32_t getRecordLength() const
346 {345 {
347346
=== modified file 'plugin/archive/ha_archive.h'
--- plugin/archive/ha_archive.h 2010-06-21 15:29:49 +0000
+++ plugin/archive/ha_archive.h 2010-07-27 23:22:44 +0000
@@ -122,10 +122,7 @@
122public:122public:
123 void start_bulk_insert(drizzled::ha_rows rows);123 void start_bulk_insert(drizzled::ha_rows rows);
124 int end_bulk_insert();124 int end_bulk_insert();
125 enum drizzled::row_type get_row_type() const125
126 {
127 return drizzled::ROW_TYPE_COMPRESSED;
128 }
129 drizzled::THR_LOCK_DATA **store_lock(drizzled::Session *session,126 drizzled::THR_LOCK_DATA **store_lock(drizzled::Session *session,
130 drizzled::THR_LOCK_DATA **to,127 drizzled::THR_LOCK_DATA **to,
131 drizzled::thr_lock_type lock_type);128 drizzled::thr_lock_type lock_type);
132129
=== modified file 'plugin/heap/ha_heap.cc'
--- plugin/heap/ha_heap.cc 2010-07-16 05:40:08 +0000
+++ plugin/heap/ha_heap.cc 2010-07-27 23:22:44 +0000
@@ -501,15 +501,6 @@
501 return 0;501 return 0;
502}502}
503503
504
505enum row_type ha_heap::get_row_type() const
506{
507 if (file->s->recordspace.is_variable_size)
508 return ROW_TYPE_DYNAMIC;
509
510 return ROW_TYPE_FIXED;
511}
512
513int ha_heap::extra(enum ha_extra_function operation)504int ha_heap::extra(enum ha_extra_function operation)
514{505{
515 return heap_extra(file,operation);506 return heap_extra(file,operation);
@@ -880,7 +871,7 @@
880 hp_create_info.with_auto_increment= found_real_auto_increment;871 hp_create_info.with_auto_increment= found_real_auto_increment;
881 hp_create_info.internal_table= internal_table;872 hp_create_info.internal_table= internal_table;
882 hp_create_info.max_chunk_size= table_arg->getShare()->block_size;873 hp_create_info.max_chunk_size= table_arg->getShare()->block_size;
883 hp_create_info.is_dynamic= (table_arg->getShare()->row_type == ROW_TYPE_DYNAMIC);874 hp_create_info.is_dynamic= false;
884875
885 error= heap_create(internal::fn_format(buff,table_name,"","",876 error= heap_create(internal::fn_format(buff,table_name,"","",
886 MY_REPLACE_EXT|MY_UNPACK_FILENAME),877 MY_REPLACE_EXT|MY_UNPACK_FILENAME),
887878
=== modified file 'plugin/heap/ha_heap.h'
--- plugin/heap/ha_heap.h 2010-04-23 17:43:11 +0000
+++ plugin/heap/ha_heap.h 2010-07-27 23:22:44 +0000
@@ -41,7 +41,7 @@
41 Cursor *clone(drizzled::memory::Root *mem_root);41 Cursor *clone(drizzled::memory::Root *mem_root);
4242
43 const char *index_type(uint32_t inx);43 const char *index_type(uint32_t inx);
44 drizzled::row_type get_row_type() const;44
45 const drizzled::key_map *keys_to_use_for_scanning() { return &btree_keys; }45 const drizzled::key_map *keys_to_use_for_scanning() { return &btree_keys; }
46 double scan_time()46 double scan_time()
47 { return (double) (stats.records+stats.deleted) / 20.0+10; }47 { return (double) (stats.records+stats.deleted) / 20.0+10; }
4848
=== modified file 'plugin/innobase/handler/ha_innodb.cc'
--- plugin/innobase/handler/ha_innodb.cc 2010-07-20 17:46:20 +0000
+++ plugin/innobase/handler/ha_innodb.cc 2010-07-27 23:22:44 +0000
@@ -2517,43 +2517,6 @@
2517*****************************************************************************/2517*****************************************************************************/
25182518
2519/****************************************************************//**2519/****************************************************************//**
2520Get the record format from the data dictionary.
2521@return one of ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT,
2522ROW_TYPE_COMPRESSED, ROW_TYPE_DYNAMIC */
2523UNIV_INTERN
2524enum row_type
2525ha_innobase::get_row_type() const
2526/*=============================*/
2527{
2528 if (prebuilt && prebuilt->table) {
2529 const ulint flags = prebuilt->table->flags;
2530
2531 if (UNIV_UNLIKELY(!flags)) {
2532 return(ROW_TYPE_REDUNDANT);
2533 }
2534
2535 ut_ad(flags & DICT_TF_COMPACT);
2536
2537 switch (flags & DICT_TF_FORMAT_MASK) {
2538 case DICT_TF_FORMAT_51 << DICT_TF_FORMAT_SHIFT:
2539 return(ROW_TYPE_COMPACT);
2540 case DICT_TF_FORMAT_ZIP << DICT_TF_FORMAT_SHIFT:
2541 if (flags & DICT_TF_ZSSIZE_MASK) {
2542 return(ROW_TYPE_COMPRESSED);
2543 } else {
2544 return(ROW_TYPE_DYNAMIC);
2545 }
2546#if DICT_TF_FORMAT_ZIP != DICT_TF_FORMAT_MAX
2547# error "DICT_TF_FORMAT_ZIP != DICT_TF_FORMAT_MAX"
2548#endif
2549 }
2550 }
2551 ut_ad(0);
2552 return(ROW_TYPE_NOT_USED);
2553}
2554
2555
2556/****************************************************************//**
2557Returns the index type. */2520Returns the index type. */
2558UNIV_INTERN2521UNIV_INTERN
2559const char*2522const char*
25602523
=== modified file 'plugin/innobase/handler/ha_innodb.h'
--- plugin/innobase/handler/ha_innodb.h 2010-06-21 16:57:08 +0000
+++ plugin/innobase/handler/ha_innodb.h 2010-07-27 23:22:44 +0000
@@ -115,12 +115,6 @@
115 return static_cast<plugin::TransactionalStorageEngine *>(engine);115 return static_cast<plugin::TransactionalStorageEngine *>(engine);
116 }116 }
117117
118 /*
119 Get the row type from the storage engine. If this method returns
120 ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used.
121 */
122 UNIV_INTERN enum row_type get_row_type() const;
123
124 UNIV_INTERN const char* index_type(uint key_number);118 UNIV_INTERN const char* index_type(uint key_number);
125 UNIV_INTERN const key_map* keys_to_use_for_scanning();119 UNIV_INTERN const key_map* keys_to_use_for_scanning();
126120
127121
=== added file 'plugin/pbms/src/pbmslib.h'
--- plugin/pbms/src/pbmslib.h 1970-01-01 00:00:00 +0000
+++ plugin/pbms/src/pbmslib.h 2010-07-15 17:00:55 +0000
@@ -0,0 +1,119 @@
1/* Copyright (c) 2008 PrimeBase Technologies GmbH, Germany
2 *
3 * PrimeBase Media Stream (PBMS)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * 2008-09-10 Barry Leslie
20 *
21 * H&G2JCtL
22 */
23#ifndef __PBMSLIB_H__
24#define __PBMSLIB_H__
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30#define MS_STANDARD_STORAGE 0 // BLOB data is stored in the repository.
31#define MS_CLOUD_STORAGE 1 // BLOB data is in S3 cloud storage.
32
33/*<DRIZZLE>*/
34#define MS_CHECKSUM_TAG "PBMS_CHECKSUM"
35#define MS_ALIAS_TAG "PBMS_BLOB_ALIAS"
36#define MS_BLOB_INFO_REQUEST "PBMS_RETURN_HEADER_ONLY"
37#define MS_PING_REQUEST "PBMS_PING_CONNECTION"
38#define MS_BLOB_SIZE "PBMS_BLOB_SIZE"
39#define MS_LAST_ACCESS "PBMS_LAST_ACCESS"
40#define MS_ACCESS_COUNT "PBMS_ACCESS_COUNT"
41#define MS_CREATION_TIME "PBMS_CREATION_TIME"
42#define MS_BLOB_TYPE "PBMS_BLOB_TYPE"
43
44#define MS_REQUEST_SIZE "PBMS_REQUEST_SIZE" // The number of bytes of BLOB data the client requests.
45#define MS_REQUEST_OFFSET "PBMS_REQUEST_OFFSET" // The offset into the BLOB that the client requests the data from.
46
47#define MS_CLOUD_SERVER "PBMS_CLOUD_SERVER"
48#define MS_CLOUD_BUCKET "PBMS_CLOUD_BUCKET"
49#define MS_CLOUD_OBJECT_KEY "PBMS_CLOUD_OBJECT_KEY"
50#define MS_CLOUD_KEY "PBMS_CLOUD_KEY"
51#define MS_BLOB_SIGNATURE "PBMS_BLOB_SIGNATURE"
52#define MS_BLOB_DATE "PBMS_BLOB_DATE" // The date used when creating the signature.
53
54#define MS_META_NAME_SIZE 32
55#define MS_META_VALUE_SIZE 1024
56#define MS_BLOB_ALIAS_SIZE MS_META_VALUE_SIZE
57#define MS_BLOB_URL_SIZE 200
58
59#ifndef PBMS_PORT
60#define DEFAULT_PBMS_PORT 8080
61#else
62#define DEFAULT_PBMS_PORT PBMS_PORT
63#endif
64
65/* PBMS handle types. */
66typedef void *PBMS; // A connection handle.
67
68typedef unsigned char pbms_bool;
69
70/* options for pbms_set_option() and pbms_get_option() */
71enum pbms_option /*: Parameter type | Information */
72{
73 PBMS_OPTION_KEEP_ALIVE, /*: unsigned int* | A boolean value indicating if the keep_alive flag should be set on HTTP requests.(Defalt = false) */
74 PBMS_OPTION_TRANSMITION_TIMEOUT, /*: unsigned int* | If greater than zero this sets a limit to how long a blob transfer can take. (Defalt = 0) */
75 PBMS_OPTION_HOST, /*: (const char *)* | The connection's Media Stream server host IP address. (Read Only) */
76 PBMS_OPTION_PORT, /*: unsigned int* | The connection's Media Stream server host port number. (Read Only) */
77 PBMS_OPTION_DATABASE /*: (const char *)* | The connection's associated database. */
78};
79
80typedef size_t (* PBMS_READ_CALLBACK_FUNC) (void *caller_data, char *buffer, size_t size, pbms_bool reset);
81typedef size_t (* PBMS_WRITE_CALLBACK_FUNC) (void *caller_data, const char *buffer, size_t size, pbms_bool reset);
82
83pbms_bool pbms_library_init();
84void pbms_library_end();
85PBMS pbms_connect(const char* host, unsigned int port, const char *database);
86
87
88void pbms_close(PBMS pbms);
89pbms_bool pbms_set_option(PBMS pbms, enum pbms_option option, const void *in_value);
90pbms_bool pbms_get_option(PBMS pbms, enum pbms_option option, void *out_value);
91int pbms_errno(PBMS pbms);
92const char *pbms_error(PBMS pbms);
93pbms_bool pbms_is_blob_reference(PBMS pbms, const char *ref);
94pbms_bool pbms_get_blob_size(PBMS pbms, const char *ref, size_t *size);
95
96/* Metadata related functions. */
97pbms_bool pbms_add_metadata(PBMS pbms, const char *name, const char *value);
98void pbms_clear_metadata(PBMS pbms, const char *name); //If name is NULL all metadata associaed with the connection is removed.
99unsigned int pbms_reset_metadata(PBMS pbms); //Resets the metadata cursor for downloaded metadata.
100pbms_bool pbms_next_metadata(PBMS pbms, char *name, char *value, size_t *v_size);
101pbms_bool pbms_get_metadata_value(PBMS pbms, const char *name, char *buffer, size_t *size);
102
103pbms_bool pbms_get_md5_digest(PBMS pbms, char *md5_digest);
104
105pbms_bool pbms_put_data(PBMS pbms, const char *table, const char *checksum, char *ref, size_t size, const unsigned char *buffer);
106pbms_bool pbms_put_data_cb(PBMS pbms, const char *table, const char *checksum, char *ref, size_t size, PBMS_READ_CALLBACK_FUNC cb, void *caller_data);
107
108pbms_bool pbms_get_data(PBMS pbms, const char *ref, unsigned char *buffer, size_t buffer_size);
109pbms_bool pbms_get_data_cb(PBMS pbms, const char *ref, PBMS_WRITE_CALLBACK_FUNC cb, void *caller_data);
110
111pbms_bool pbms_get_data_range(PBMS pbms, const char *ref, size_t start_offset, size_t end_offset, unsigned char *buffer, size_t buffer_size, size_t *data_size);
112pbms_bool pbms_get_data_range_cb(PBMS pbms, const char *ref, size_t start_offset, size_t end_offset, PBMS_WRITE_CALLBACK_FUNC cb, void *caller_data);
113
114pbms_bool pbms_get_info(PBMS pbms, const char *ref);
115
116#ifdef __cplusplus
117}
118#endif
119#endif // __PBMSLIB_H__
0120
=== modified file 'plugin/schema_dictionary/tables.cc'
--- plugin/schema_dictionary/tables.cc 2010-07-15 23:18:11 +0000
+++ plugin/schema_dictionary/tables.cc 2010-07-27 23:22:44 +0000
@@ -30,13 +30,6 @@
30static const string INTERNAL("INTERNAL");30static const string INTERNAL("INTERNAL");
31static const string FUNCTION("FUNCTION");31static const string FUNCTION("FUNCTION");
3232
33static const string DEFAULT("DEFAULT");
34static const string FIXED("FIXED");
35static const string DYNAMIC("DYNAMIC");
36static const string COMPRESSED("COMPRESSED");
37static const string REDUNDANT("REDUNDANT");
38static const string COMPACT("COMPACT");
39static const string PAGE("PAGE");
4033
41static const string VARCHAR("VARCHAR");34static const string VARCHAR("VARCHAR");
42static const string DOUBLE("DOUBLE");35static const string DOUBLE("DOUBLE");
@@ -92,35 +85,6 @@
92 return false;85 return false;
93}86}
9487
95void TablesTool::Generator::pushRow(message::Table::TableOptions::RowType type)
96{
97 switch (type)
98 {
99 default:
100 case message::Table::TableOptions::ROW_TYPE_DEFAULT:
101 push(DEFAULT);
102 break;
103 case message::Table::TableOptions::ROW_TYPE_FIXED:
104 push(FIXED);
105 break;
106 case message::Table::TableOptions::ROW_TYPE_DYNAMIC:
107 push(DYNAMIC);
108 break;
109 case message::Table::TableOptions::ROW_TYPE_COMPRESSED:
110 push(COMPRESSED);
111 break;
112 case message::Table::TableOptions::ROW_TYPE_REDUNDANT:
113 push(REDUNDANT);
114 break;
115 case message::Table::TableOptions::ROW_TYPE_COMPACT:
116 push(COMPACT);
117 break;
118 case message::Table::TableOptions::ROW_TYPE_PAGE:
119 push(PAGE);
120 break;
121 }
122}
123
124void TablesTool::Generator::pushType(message::Table::Field::FieldType type)88void TablesTool::Generator::pushType(message::Table::Field::FieldType type)
125{89{
126 switch (type)90 switch (type)
@@ -196,7 +160,7 @@
196 push(getTableMessage().engine().name());160 push(getTableMessage().engine().name());
197161
198 /* ROW_FORMAT */162 /* ROW_FORMAT */
199 pushRow(getTableMessage().options().row_type());163 push("DEFAULT");
200164
201 /* TABLE_COLLATION */165 /* TABLE_COLLATION */
202 push(getTableMessage().options().collation());166 push(getTableMessage().options().collation());
203167
=== modified file 'plugin/schema_dictionary/tables.h'
--- plugin/schema_dictionary/tables.h 2010-07-06 23:50:55 +0000
+++ plugin/schema_dictionary/tables.h 2010-07-27 23:22:44 +0000
@@ -47,7 +47,6 @@
4747
48 bool nextTable();48 bool nextTable();
4949
50 void pushRow(drizzled::message::Table::TableOptions::RowType type);
51 void pushType(drizzled::message::Table::Field::FieldType type);50 void pushType(drizzled::message::Table::Field::FieldType type);
5251
53 const std::string &table_name()52 const std::string &table_name()