New branch 'features/base-preview' available with the following commits: commit 8490067159d54b3b8e2f074978753a8bdc15879b Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Mon Jun 4 17:54:30 2012 +0200
i#102625 avoid fetching same row twice in different queries We do a "SELECT * FROM table" just to fetch the primary key columns; so reuse the same XResultSet to fetch all columns. Else, we immediately issue a "SELECT * FROM table WHERE primary_key=current_value" to read the other columns, which is wasteful and particularly silly. Commit 1ae17f5b03cc14844fb600ca3573a96deb37ab3b already tried to do that, but was essentially reverted piecewise because it caused fdo#47520, fdo#48345, fdo#50372. Commit c08067d6da94743d53217cbc26cffae00a22dc3a thought it did that, but actually reverted commit 1ae17f5b03cc14844fb600ca3573a96deb37ab3b. This implementation fetches the whole current row and caches it in memory; only one row is cached: when the current row changes, the cache contains the new current row. This could be problematic (wrt to memory consumption) if the current row is big (e.g. with BLOBs) and nobody is interested in the data anyway (as would often be the case with BLOBs). Note that because of our "SELECT *", the driver most probably has it in memory already anyway, so we don't make the situation that much worse. This could be incrementally improved with a heuristic of not preemptively caching binary data (and also not LONGVARCHAR / TEXT / MEMO / ...); a getFOO on these columns would issue a specific "SELECT column FROM table WHERE primary_key=current_value" each time. The *real* complete fix to all these issues would be to not do "SELECT *" at all. Use "SELECT pkey_col1, pkey_col2, ..." when we are only interested in the key columns. As to data, somehow figure out which columns were ar interested in and "SELECT" only these (and maybe only those with "small datatype"?). Interesting columns could be determined by our caller (creator) as an argument to our constructor, or some heuristic (no binary data, no "big" unbound data). Also be extra smart and use *(m_aKeyIter) when getFOO is called on a column included in it (and don't include it in any subsequent SELECT). However, there are several pitfalls. One is buggy drivers that give use column names of columns that we cannot fetch :-| Using "SELECT *" works around that because the driver there *obviously* gives us only fetchable columns in the result. Another one is the very restrictive nature of some database access technologies. Take for example ODBC: - Data can be fetched only *once* (with the SQLGetData interface; bound columns offer a way around that, but that's viable only for constant-length data, not variable-length data). This could be addressed by an intelligent & lazy cache. - Data must be fetched in increasing order of column number (again, this is about SQLGetData). This is a harder issue. The current solution has the nice advantage of completely isolating the rest of LibO from these restrictions. I don't currently see how to cleanly avoid (potentially unnecessarily) caching column 4 if we are asked for column 3 then column 5, just in case we are asked for column 4 later on, unless we issue a specific "SELECT column4" later. But the latter would be quite expensive in terms of app-to-database roudtripe times :-( and thus creates another performance issue. Change-Id: I999b3f8f0b8a215acb390ffefc839235346e8353 commit 4b103279f910a5c73c3ba71318e2a02b825b4a5a Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Mon Jun 4 17:41:33 2012 +0200 Need to refresh row after moving to bookmark! Change-Id: Ia8d12d02829087309e248506a7d3b0f94b5a425e commit f066b483e859a95610eb874917071e32df09cf0e Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Mon Jun 4 17:40:30 2012 +0200 Cleanup m_xSet in destructor Change-Id: I3d7023fcb1857da1ef107a8af0d373b9ca464f03 commit 038f141c12bb6472bcd6ddad1d303c810a589d36 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Mon Jun 4 17:35:52 2012 +0200 typos in comments Change-Id: I1dbb1990033602d7909ecdee72b8b699cce44cab commit 4194b560faaa2ed3ebbc8201ec974b3125b609b8 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Mon Jun 4 17:31:25 2012 +0200 Remove wrong optimisation fixup of d4ae29a37873843c20fe7d5f5f071f8fb201fed9 after the call to m_pCacheSet->absolute_checked, the data *is* used, so we cannot anymore exempt m_pCacheSet from giving correct data. Change-Id: I7d3644ca08ce43cb030a80984605a1f8a8a64211 commit 9e5fdfef9b86b56154fd7d77a6a49316816a6747 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Fri Jun 1 16:40:41 2012 +0200 fdo#47520 use the already retrieved row instead of driver row This avoids asking the driver for the same data twice. This is particularly important for ODBC data sources, because when asking for (VAR)CHAR data the second time, one gets no data (and status SQL_NO_DATA) because of the "retrieve in parts" semantics of these datatypes. Change-Id: I96f2df9927fda72ccf19f78ec5c561f5626c003f commit 6f82d541981e4fa2e0cf927b63f3424c4384f645 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Fri Jun 1 15:42:27 2012 +0200 OKeySet::refreshRow: Invalidate m_xRow/m_xSet when BeforeFirst or AfterLast Change-Id: I0f48c099eddc077b2a89e3b7fab66b5da55b57c8 commit 18712bc28d90a429b667c3d5e3178fd82ff8c8f1 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Fri Jun 1 14:52:46 2012 +0200 organise & comment code better Continuation of commits to fix fdo#48345 Change-Id: Ie28f6a55cd8715a7180f5d88fe23c5b310440744 commit f9f441c8f45dde62179c4db601c41ab474437c6c Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Fri Jun 1 14:49:02 2012 +0200 Update comments Change-Id: I7e3f09d61cb35165000a35c8d3c3f2d284cf164e commit 563459d8adacacc729990432805b9020a4fb1445 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Fri Jun 1 11:42:53 2012 +0200 fdo#50372: crash when refresh of last already-known row unexpectedly fails Instead, try to do the least unreasonable thing: Fetch a new row If that fails because no new row to fetch, at least we are properly positioned after last row. Calling code may not expect that and get confused, but that is the best we can do. Change-Id: Ib7248e99ae3deee8344e9386cac2c9440e8bccd8 commit 4cd765dfb9382e23c7964a3029f197d3be5d764e Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Fri Jun 1 11:38:59 2012 +0200 dbaccess::OKeySet::wasNull(): OSL_ENSURE we have a m_xRow Change-Id: I087d2893d853f431d27c592ba26bdc16e0a9cb84 commit fb3c54d7399f42a93f59cdfd0ed3b688825ea99a Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Wed Apr 4 16:00:52 2012 +0200 ORowSetCache::moveWindow m_nEndPos == m_nStartPos == 0 is OK commit 2f14ac0d43eb3b422adb6ac997593f51878c9bc1 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Mon Feb 27 13:47:24 2012 +0100 fdo#46675: fixup commit 68e930dec3947ca9910de0c29516c1b4f1f1d272 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Mon Feb 27 13:10:40 2012 +0100 fdo#46675: expand group memberships in get*Privileges commit 5e54cf41a8a5dc02f55d7e6b018b64bd8152b80f Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Thu Feb 16 09:29:54 2012 +0100 correct indentation commit b93479829a2ba2966868c2360281c292d2ec9799 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Thu Feb 16 09:11:08 2012 +0100 typo & copy/paste error in error message commit d5463bdf9e2f6ef29e1208f54f09d0562fdd3fce Author: Kate Goss <katherine.g...@gmail.com> Date: Mon Feb 13 21:53:08 2012 +0000 Remove unused code from connectivity::odbc::OPreparedStatement Remove methods getDataBuf(int), getParamLength(int), getPrecision(int). commit 92cf39fac7fadbff1d82cfe8c64b668e9cc645d9 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Feb 14 19:41:08 2012 +0100 ODBC: align *all* the handling of SQLULEN properties with maximal ODBC size commit 76fd557fa057e04f7c122026e63d1c4fb71445f3 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Feb 14 19:39:01 2012 +0100 comphelper: add getINT64 commit dbdd305b98f4602434e732ea3aea6685d16c67d2 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Feb 14 18:34:52 2012 +0100 improve OTools::binParameter/bindData interaction Don't duplicate the decision point for "data at execution or copied data" commit 826a3219cfe1ed2a6e4b4743b5a0277a6d9eca7c Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Feb 14 09:49:19 2012 +0100 new[] already allocates each element of the array And calls the default constructor, naturally. commit feba007143ef256a218c21e3eb5a5986cf402a18 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Feb 14 06:27:51 2012 +0100 odbc getTableTypes: ask the driver instead of guessing commit 95b173766aed92fc5247c35b6d401f53a8b95b7e Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Mon Feb 13 17:53:19 2012 +0100 ResMgr::TestStack more robust commit 93031cc32eb90501e208c9e8f973e6f2d8211aa2 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Thu Feb 9 13:06:27 2012 +0100 reorganise code for better readability No behaviour change intended. However, if behaviour changed, probably the *old* behaviour is buggy, not new one. commit 24dc2d6859dcb0977abab79cc1e41a15d6f696a1 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Thu Feb 9 13:04:34 2012 +0100 typo in comment commit f66c3e368d3df2c567606b2028d26889f28cb549 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Thu Feb 9 13:03:24 2012 +0100 ORowSetCache::moveWindow: yet another off-by-one error commit d6399b2fc64a0a8c0751f7a5fdcbadd1747592b9 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Wed Feb 8 19:08:20 2012 +0100 ORowSetCache::moveWindow fix variable inversion; fixes subsequentcheck commit 21a619d8bb25f2baade587fb56103adb600a4b11 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Wed Feb 8 12:41:54 2012 +0100 ORowSetCache: handle case total data < m_nFetchSize As a drive-by: fillMatrix update m_nEndSize commit 2c0ee8afeda12339f1ac5c3083920e1a7d7edf71 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 31 11:39:47 2012 +0100 pgsql: simpler / safer check for system column commit 7a0c33c46c44fb1987738ace72614985fe039685 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Wed Feb 1 18:28:59 2012 +0100 pgsql: implement getColumnPrivileges, generate statement only once commit 757655da9474e283ce4d29238541a3be303da036 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Wed Feb 1 18:03:40 2012 +0100 pgsql: clean comments commit 51265c90ea9009616d029295780e250758c881a6 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 31 22:53:31 2012 +0100 ORowSetCache: keep m_nEndPos better up-to-date commit c07c1dc8c07aeaacfd7588a4ab938c32e81a142a Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 24 22:20:31 2012 +0100 make OTools::getValue insanely safe, factorise get{Int,Long,Byte,...} commit 731cfb6d43fa91117941c8677ce0be829abcee21 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Mon Jan 23 10:19:55 2012 +0100 ORowSetCache::fillMatrix(): fix case m_nFetchsize > table size When lowering m_nStartPos, do not duplicate rows above its old value commit e831eec859da8022b8f0f9511f69f6c72bb0583d Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sun Jan 22 01:35:58 2012 +0100 ORowSetCache::fillMatrix(): correct off-by-one error Symptom: segfault. Thanks to Julien Nabet for precise pointer to problematic code. commit fb37ff81a6a1d71069080aa98fd857d8194bb557 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Thu Jan 19 20:20:06 2012 +0100 ORowSetCache: overhaul internals commit a2d7b33bea9552c938ade88798ec7ab7586d7a99 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Thu Jan 19 17:54:10 2012 +0100 janitorial: don't rely on detail of current OSL_ENSURE implementation As in: that the compiler won't see the variables in the condition when OSL_DEBUG_LEVEL==0 commit 26fc2ac5fd2ead77a06422f2828c89693f86fe73 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Thu Jan 19 17:49:32 2012 +0100 column position 0 is perfectly valid On the other hand, column position 1 is not guaranteed to exist. nCurPos will be BROWSER_INVALID_ID, not 0, in case of error in setting it commit f31d0036c36584d487b66a3a51b84ab66ddfc1a5 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Wed Jan 18 13:51:14 2012 +0100 Oups... where is my brown paper bag? commit 0bb79c03190bf2581131427d0ba24c644f7b297c Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Wed Jan 18 13:10:12 2012 +0100 OKeySet: tryRefetch and refreshRow share most of their code commit 154acbfecfc5a5c17fa6a71a938031495c119511 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Wed Jan 18 12:31:06 2012 +0100 janitorial: typo in comments commit f6bfea0131696fcd8a0a26b623b5881d8973920e Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 17 13:34:04 2012 +0100 DbGridControl::SeekCursor: show exception when seek fails (and debug build) commit c76af24830970895bedcd6dfabca478ecb87c1c4 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 17 09:27:40 2012 +0100 janitorial: typo in private member name commit 2708ff44b7786d403bbf2807efdcf1a575d3b77a Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 17 09:26:41 2012 +0100 janitorial: const iterator where may be, indentation commit 85db679b8ca6db7848d4c54c60cfb519d60caa38 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 17 15:21:41 2012 +0100 Also teach "foo IS [NOT] bar" to our SQL parser (when bar is not NULL) Syntax supported by at least SQLite. commit 0c7f81b9ee2c924b271555961a7675cce194ee22 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 17 09:03:17 2012 +0100 fdo#44813: teach "IS (NOT) DISTINCT FROM" to our SQL parser commit 46bc08486c66c4024a13cd41bc294b02583df73f Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Thu Jan 12 15:54:56 2012 +0100 LEM TMP: work around fdo#44721 commit f5fc11a17f562c2169dc95c6ff45f4bff30994bf Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Sun Nov 20 17:37:39 2011 +0100 LEM TODO note commit 8a40a83b86cdc4490ad08665dce7eda1edb8e232 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Wed Nov 23 21:34:18 2011 +0100 maximal debugging information _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits