From: <ibr...@us...> - 2011-02-12 00:11:25
|
Revision: 3877 http://tora.svn.sourceforge.net/tora/?rev=3877&view=rev Author: ibre5041 Date: 2011-02-12 00:11:18 +0000 (Sat, 12 Feb 2011) Log Message: ----------- When selecting from table having LONG column set buffer fetch size to 1 Modified Paths: -------------- trunk/tora/src/trotl/src/trotl_cursor.h trunk/tora/src/trotl/src/trotl_stat.cpp trunk/tora/src/trotl/src/trotl_stat.h trunk/tora/src/trotl/src/trotl_string.cpp Modified: trunk/tora/src/trotl/src/trotl_cursor.h =================================================================== --- trunk/tora/src/trotl/src/trotl_cursor.h 2011-02-07 16:13:42 UTC (rev 3876) +++ trunk/tora/src/trotl/src/trotl_cursor.h 2011-02-12 00:11:18 UTC (rev 3877) @@ -71,7 +71,7 @@ }; void fetch() { - SqlStatement::fetch(_buff_size); + SqlStatement::fetch(_fetch_rows); }; }; void descAlloc(void); Modified: trunk/tora/src/trotl/src/trotl_stat.cpp =================================================================== --- trunk/tora/src/trotl/src/trotl_stat.cpp 2011-02-07 16:13:42 UTC (rev 3876) +++ trunk/tora/src/trotl/src/trotl_stat.cpp 2011-02-12 00:11:18 UTC (rev 3877) @@ -69,7 +69,7 @@ _last_row(-1), _last_fetched_row(-1), _in_pos(0), _out_pos(0), _iters(0), -_last_buff_row(0), _buff_size(g_OCIPL_BULK_ROWS), +_last_buff_row(0), _buff_size(g_OCIPL_BULK_ROWS), _fetch_rows(g_OCIPL_BULK_ROWS), _all_binds(NULL), _in_binds(NULL), _out_binds(NULL), _bound(false) // _res(NULL), @@ -250,6 +250,9 @@ .arg(_columns[dpos]._data_type_name) .arg(_columns[dpos]._reg_name); define(*_all_defines[dpos]); + + if(_all_defines[dpos]->dty == SQLT_LNG) + _fetch_rows = 1; } _state |= DEFINED; } @@ -447,7 +450,7 @@ { define_all(); } - fetch(_buff_size); + fetch(_fetch_rows); _last_fetched_row = row_count(); } @@ -516,7 +519,7 @@ res2 = OCICALL(OCIStmtSetPieceInfo((dvoid *)hdlptr, (ub4)hdltype, _errh, (dvoid *) BPp->valuep, &alen, piece, (dvoid *)&indptr, &rcode)); oci_check_error(__TROTL_HERE__, _errh, res2); - res = OCICALL(OCIStmtFetch(_handle, _errh, rows, OCI_FETCH_NEXT, OCI_DEFAULT)); + res = OCICALL(OCIStmtFetch(_handle, _errh, 1, OCI_FETCH_NEXT, OCI_DEFAULT)); if(res == OCI_NEED_DATA || res == OCI_NO_DATA || res == OCI_SUCCESS || res == OCI_SUCCESS_WITH_INFO) BPp->fetch_hook(iter, idx, piece, alen, indptr); } @@ -1088,7 +1091,7 @@ _state |= EOF_DATA; if(_last_buff_row == fetched_rows() && ((_state & EOF_DATA) == 0) && get_stmt_type() == STMT_SELECT) - fetch(_buff_size); + fetch(_fetch_rows); return *this; }; @@ -1112,7 +1115,7 @@ _state |= EOF_DATA; if(_last_buff_row == fetched_rows() && ((_state & EOF_DATA) == 0) && get_stmt_type() == STMT_SELECT) - fetch(_buff_size); + fetch(_fetch_rows); return *this; }; @@ -1136,7 +1139,7 @@ _state |= EOF_DATA; if(_last_buff_row == fetched_rows() && ((_state & EOF_DATA) == 0) && get_stmt_type() == STMT_SELECT) - fetch(_buff_size); + fetch(_fetch_rows); return *this; }; @@ -1161,7 +1164,7 @@ _state |= EOF_DATA; if(_last_buff_row == fetched_rows() && ((_state & EOF_DATA) == 0) && get_stmt_type() == STMT_SELECT) - fetch(_buff_size); + fetch(_fetch_rows); return *this; }; @@ -1185,7 +1188,7 @@ _state |= EOF_DATA; if(_last_buff_row == fetched_rows() && ((_state & EOF_DATA) == 0) && get_stmt_type() == STMT_SELECT) - fetch(_buff_size); + fetch(_fetch_rows); return *this; }; @@ -1209,7 +1212,7 @@ _state |= EOF_DATA; if(_last_buff_row == fetched_rows() && ((_state & EOF_DATA) == 0) && get_stmt_type() == STMT_SELECT) - fetch(_buff_size); + fetch(_fetch_rows); return *this; }; @@ -1232,7 +1235,7 @@ _state |= EOF_DATA; if(_last_buff_row == fetched_rows() && ((_state & EOF_DATA) == 0) && get_stmt_type() == STMT_SELECT) - fetch(_buff_size); + fetch(_fetch_rows); return *this; } @@ -1273,7 +1276,7 @@ _state |= EOF_DATA; if(_last_buff_row == fetched_rows() && ((_state & EOF_DATA) == 0) && get_stmt_type() == STMT_SELECT) - fetch(_buff_size); + fetch(_fetch_rows); return *this; } @@ -1307,7 +1310,7 @@ _state |= EOF_DATA; // if(_last_buff_row == fetched_rows() && ((_state & EOF_DATA) == 0) && get_stmt_type() == STMT_SELECT) -// fetch(_buff_size); +// fetch(_fetch_rows); return *this; } @@ -1483,7 +1486,7 @@ if(_last_buff_row == fetched_rows() && ((_state & EOF_DATA) == 0) && get_stmt_type() == STMT_SELECT) { - fetch(_buff_size); + fetch(_fetch_rows); } return *this; Modified: trunk/tora/src/trotl/src/trotl_stat.h =================================================================== --- trunk/tora/src/trotl/src/trotl_stat.h 2011-02-07 16:13:42 UTC (rev 3876) +++ trunk/tora/src/trotl/src/trotl_stat.h 2011-02-12 00:11:18 UTC (rev 3877) @@ -363,7 +363,7 @@ /* _state |= EOF_DATA; */ /* if(_last_buff_row == fetched_rows() && ((_state & EOF_DATA) == 0) && get_stmt_type() == STMT_SELECT) */ -/* fetch(_buff_size); */ +/* fetch(_fetch_rows); */ /* return *this; */ /* } */ @@ -409,7 +409,7 @@ mutable ub4 _param_count, _column_count, _in_cnt, _out_cnt; ub4 _last_row, _last_fetched_row, _in_pos, _out_pos, _iters; - ub4 _last_buff_row, _buff_size; // used in select statements + ub4 _last_buff_row, _buff_size, _fetch_rows; // used in select statements mutable ub4 _fetched_row; std::vector<ColumnType> _columns; // TODO move into some SQL-result class Modified: trunk/tora/src/trotl/src/trotl_string.cpp =================================================================== --- trunk/tora/src/trotl/src/trotl_string.cpp 2011-02-07 16:13:42 UTC (rev 3876) +++ trunk/tora/src/trotl/src/trotl_string.cpp 2011-02-12 00:11:18 UTC (rev 3877) @@ -56,6 +56,12 @@ void BindParLong::fetch_hook(ub4 iter, ub4 idx, ub1 piece, ub4 alen, sb2 ind) { + std::cerr << "\t iter: " << iter + << "\t idx: " << idx + << "\t piece: " << (unsigned short)piece + << "\t alen: " << alen + << "\t ind: " << ind + << std::endl; if(piece == OCI_FIRST_PIECE) { s.at(iter)->clear(); @@ -135,7 +141,7 @@ // len = PIECE_SIZE; // *alenpp = &len; - + // ind = 0; // if (glGetInd) // *indpp = (dvoid *) &ind; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |