aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-12-21 15:35:51 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-12-21 15:35:51 +0200
commit522cd0432ca20207dfb1e8be9d4e0980158a7771 (patch)
tree2a609333478f96c7ab4970fb4f8707c1a7797849
parent28b329b63a3919020a9286b557f7938dc8fbd746 (diff)
Do not select object id in container SELECT statement
-rw-r--r--odb/mssql/container-statements.hxx16
-rw-r--r--odb/mssql/container-statements.txx21
2 files changed, 22 insertions, 15 deletions
diff --git a/odb/mssql/container-statements.hxx b/odb/mssql/container-statements.hxx
index 6d9dd56..402f4ca 100644
--- a/odb/mssql/container-statements.hxx
+++ b/odb/mssql/container-statements.hxx
@@ -151,6 +151,12 @@ namespace odb
return data_image_binding_;
}
+ binding&
+ select_image_binding ()
+ {
+ return select_image_binding_;
+ }
+
//
// Statements.
//
@@ -178,8 +184,7 @@ namespace odb
conn_,
select_all_text_,
cond_image_binding_,
- data_image_binding_,
- 4096)); // Hardcode a 4kB LOB prefetch size.
+ select_image_binding_));
return *select_all_;
}
@@ -209,13 +214,12 @@ namespace odb
std::size_t cond_image_version_;
std::size_t cond_id_binding_version_;
binding cond_image_binding_;
- bind* cond_image_bind_;
data_image_type data_image_;
std::size_t data_image_version_;
std::size_t data_id_binding_version_;
binding data_image_binding_;
- bind* data_image_bind_;
+ binding select_image_binding_; // Skips the id from data_image_binding.
const char* insert_one_text_;
const char* select_all_text_;
@@ -243,8 +247,8 @@ namespace odb
container_statements_impl& operator= (const container_statements_impl&);
private:
- bind cond_image_bind_array_[traits::cond_column_count];
- bind data_image_bind_array_[traits::data_column_count];
+ bind cond_image_bind_[traits::cond_column_count];
+ bind data_image_bind_[traits::data_column_count];
};
}
}
diff --git a/odb/mssql/container-statements.txx b/odb/mssql/container-statements.txx
index cc240bb..0fed749 100644
--- a/odb/mssql/container-statements.txx
+++ b/odb/mssql/container-statements.txx
@@ -21,8 +21,9 @@ namespace odb
&traits::load_all,
&traits::delete_all),
id_binding_ (0),
- cond_image_binding_ (0, 0), // Initialized by impl.
- data_image_binding_ (0, 0) // Initialized by impl.
+ cond_image_binding_ (0, 0), // Initialized by impl.
+ data_image_binding_ (0, 0), // Initialized by impl.
+ select_image_binding_ (0, 0) // Initialized by impl.
{
cond_image_.version = 0;
cond_image_version_ = 0;
@@ -38,17 +39,19 @@ namespace odb
container_statements_impl (connection_type& conn)
: base (conn)
{
- this->cond_image_bind_ = cond_image_bind_array_;
- this->data_image_bind_ = data_image_bind_array_;
-
- this->cond_image_binding_.bind = this->cond_image_bind_;
+ this->cond_image_binding_.bind = cond_image_bind_;
this->cond_image_binding_.count = traits::cond_column_count;
- this->data_image_binding_.bind = this->data_image_bind_;
+ this->data_image_binding_.bind = data_image_bind_;
this->data_image_binding_.count = traits::data_column_count;
- std::memset (cond_image_bind_array_, 0, sizeof (cond_image_bind_array_));
- std::memset (data_image_bind_array_, 0, sizeof (data_image_bind_array_));
+ this->select_image_binding_.bind = data_image_bind_ +
+ traits::id_column_count;
+ this->select_image_binding_.count = traits::data_column_count -
+ traits::id_column_count;
+
+ std::memset (cond_image_bind_, 0, sizeof (cond_image_bind_));
+ std::memset (data_image_bind_, 0, sizeof (data_image_bind_));
this->insert_one_text_ = traits::insert_one_statement;
this->select_all_text_ = traits::select_all_statement;