Re: About parts in ODatabaseMetaData.cxx (connectivy module/odbc part)
It should be an option (though I've not looked at the code), because dbf is a *FILE* format that allows for deleted rows to remain in the dataset (as deleted). If you're working with a full database engine you would not (or at least, should not) expect that deleted data would remain in an accessible state. Regards Mark Stanton ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: About parts in ODatabaseMetaData.cxx (connectivy module/odbc part)
Le 07/04/14 16:24, Lionel Elie Mamane a écrit : Hi Lionel, > > "used to allow" means that this is not possible anymore? > No, it means that I haven't checked whether it is still available. From memory, when one had a dbf table, and did a left mouse button click on the left hand edge of the table view grid control, a context menu was displayed and one could choose to compact the db, permanently wiping the deleted tuples, so it wasn't really a toggle on/off UI switch I suppose, although it looked that way to the user. Alex ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: About parts in ODatabaseMetaData.cxx (connectivy module/odbc part)
On Fri, Apr 04, 2014 at 02:20:41PM +0200, Alex Thurgood wrote: > In StarOffice 5.x and then OpenOffice.org, the DBF driver used to allow > a user to see deleted tuples in the data source browser pane and in > table view mode, and as far as I can remember it was an option in the UI > that could be switched on/off. "used to allow" means that this is not possible anymore? -- Lionel ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: About parts in ODatabaseMetaData.cxx (connectivy module/odbc part)
Lionel Elie Mamane wrote > It would seem to me that indeed the "ownDeletesAreVisible" is > wrong. OTOH, it was "==" and it was changed in (by Ocke Janssen, not > Olivier > Bolte, who as far as I understand has done the merge): > ... > So I would like to be cautious there. I cannot find any definite > source whether "ownDeletesAreVisible" means "the deleted rows are > still visible" or "the delete action is visible -> the deleted rows > are not visible". If we can find some good documentation or example > from another JDBC driver... I found a French link (but it's not official), http://blog.paumard.org/cours/jdbc/chap05-resultset-types.html " On peut tester si notre ResultSet voit ses propres suppressions ou pas, par appel à la méthode DatabaseMetaData.ownDeletesAreVisible(int type). Si elles le sont, alors la méthode rowDeleted() retourne true si la ligne a été effacée, false sinon Il est important de savoir si un ResultSet est sensible ou non aux lignes que l'on efface dedans, car dans certaines implémentations, les lignes effacées ne sont pas retirées, mais remplacées par des lignes vides. " quick and dirty translation: "We can test if our resultset sees its own deletes or not, when calling DatabaseMetaData.ownDeletesAreVisible(int type). If deletes are visible, so the RowDeleted() method returns "true" if the row has been removed, false otherwise. .. It's important to know if a Resultset takes into account the rows deleted in it, because in some implementations, the deleted rows are not removed but replaced by empty rows. " Julien -- View this message in context: http://nabble.documentfoundation.org/About-parts-in-ODatabaseMetaData-cxx-connectivy-module-odbc-part-tp4104005p4104183.html Sent from the Dev mailing list archive at Nabble.com. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: About parts in ODatabaseMetaData.cxx (connectivy module/odbc part)
Thank you Lionel for your feedback. Here's a proposed patch here: https://gerrit.libreoffice.org/#/c/8863/ Julien -- View this message in context: http://nabble.documentfoundation.org/About-parts-in-ODatabaseMetaData-cxx-connectivy-module-odbc-part-tp4104005p4104182.html Sent from the Dev mailing list archive at Nabble.com. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: About parts in ODatabaseMetaData.cxx (connectivy module/odbc part)
On Thu, Apr 03, 2014 at 01:28:24PM -0700, julien2412 [via Document Foundation Mail Archive] wrote: > Also, I noticed in this same file: >1252 sal_Int32 SAL_CALL > ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, > RuntimeException, std::exception) >1253 { >1254 SQLUINTEGER nValue; >1255 > OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this); >1256 return nValue; >1257 } > Searching about getDefaultTransactionIsolation, I found > SQL_DEFAULT_TXN_ISOLATION. But this attribute isn't in sqlext.h but in > isqlext.h (see > http://sourcecodebrowser.com/unixodbc/2.2.11/nn_2isqlext_8h.html) > Nevertheless, looking the number of locations where sqlext.h is used in LO, > I wonder what impact would be including isqlext.h > Still, the above code with SQL_SUBQUERIES seems weird. Why would there be any problem in including isqlext.h? Just do it... Yes, the above call with SQL_SUBQUERIES looks obviously wrong, and needs to be replaced by SQL_DEFAULT_TXN_ISOLATION + translating from ODBC constants (SQL_TXN_READ_UNCOMMITTED, SQL_TXN_READ_COMMITTED, SQL_TXN_REPEATABLE_READ, SQL_TXN_SERIALIZABLE) to SDBC constants (com::sun::star::sdbc::TransactionIsolation). -- Lionel -- View this message in context: http://nabble.documentfoundation.org/About-parts-in-ODatabaseMetaData-cxx-connectivy-module-odbc-part-tp4104005p4104094.html Sent from the Dev mailing list archive at Nabble.com.___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: About parts in ODatabaseMetaData.cxx (connectivy module/odbc part)
Le 04/04/2014 13:13, Lionel Elie Mamane a écrit : Hi, > So I would like to be cautious there. I cannot find any definite > source whether "ownDeletesAreVisible" means "the deleted rows are > still visible" or "the delete action is visible -> the deleted rows > are not visible". If we can find some good documentation or example > from another JDBC driver... In StarOffice 5.x and then OpenOffice.org, the DBF driver used to allow a user to see deleted tuples in the data source browser pane and in table view mode, and as far as I can remember it was an option in the UI that could be switched on/off. Alex ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: About parts in ODatabaseMetaData.cxx (connectivy module/odbc part)
On Thu, Apr 03, 2014 at 02:02:08PM -0700, julien2412 [via Document Foundation Mail Archive] wrote: > I found another part however: >1622 sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 > setType ) throw(SQLException, RuntimeException, std::exception) > ... >1641 return (nValue & SQL_CA2_SENSITIVITY_DELETIONS) != > SQL_CA2_SENSITIVITY_DELETIONS; >1642 } > whereas we have: >1644 sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 > setType ) throw(SQLException, RuntimeException, std::exception) > ... >1663 return (nValue & SQL_CA2_SENSITIVITY_ADDITIONS) == > SQL_CA2_SENSITIVITY_ADDITIONS; >1664 } > (See > http://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx#1622) > One of them must be wrong. It would seem to me that indeed the "ownDeletesAreVisible" is wrong. OTOH, it was "==" and it was changed in (by Ocke Janssen, not Olivier Bolte, who as far as I understand has done the merge): commit bb075c9e3f2f8e0e9ce073a3dad5201f4e5fcc91 Author: Oliver Bolte Date: Fri Mar 18 08:57:23 2005 + INTEGRATION: CWS dba25 (1.27.204); FILE MERGED 2005/03/04 11:37:35 oj 1.27.204.2: simple correct for ownDeletesAreVisible 2005/03/04 10:12:19 oj 1.27.204.1: correct operator order So I would like to be cautious there. I cannot find any definite source whether "ownDeletesAreVisible" means "the deleted rows are still visible" or "the delete action is visible -> the deleted rows are not visible". If we can find some good documentation or example from another JDBC driver... -- Lionel -- View this message in context: http://nabble.documentfoundation.org/About-parts-in-ODatabaseMetaData-cxx-connectivy-module-odbc-part-tp4104005p4104066.html Sent from the Dev mailing list archive at Nabble.com.___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: About parts in ODatabaseMetaData.cxx (connectivy module/odbc part)
Re reading part 1), i was obviously wrong. SQL_ORDER_BY_COLUMNS_IN_SELECT indicates if columns contained in order by clause must be in Select part. So it's normal supportsOrderByUnrelated must test this value equal to 'N' I found another part however: 1622 sal_Bool SAL_CALL ODatabaseMetaData::ownDeletesAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception) ... 1641 return (nValue & SQL_CA2_SENSITIVITY_DELETIONS) != SQL_CA2_SENSITIVITY_DELETIONS; 1642 } whereas we have: 1644 sal_Bool SAL_CALL ODatabaseMetaData::ownInsertsAreVisible( sal_Int32 setType ) throw(SQLException, RuntimeException, std::exception) ... 1663 return (nValue & SQL_CA2_SENSITIVITY_ADDITIONS) == SQL_CA2_SENSITIVITY_ADDITIONS; 1664 } (See http://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx#1622) One of them must be wrong. Julien -- View this message in context: http://nabble.documentfoundation.org/About-parts-in-ODatabaseMetaData-cxx-connectivy-module-odbc-part-tp4104005p4104014.html Sent from the Dev mailing list archive at Nabble.com. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
About parts in ODatabaseMetaData.cxx (connectivy module/odbc part)
Hello, Taking a look at connectivity/source/drivers/odbc/ODatabaseMetaData.cxx without particular reason, I noticed this: 1044 sal_Bool SAL_CALL ODatabaseMetaData::supportsOrderByUnrelated( ) throw(SQLException, RuntimeException, std::exception) 1045 { 1046 OUString aValue; 1047 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_ORDER_BY_COLUMNS_IN_SELECT,aValue,*this,m_pConnection->getTextEncoding()); 1048 return aValue.toChar() == 'N'; 1049 } See http://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx#1044 Whereas all the other blocks compare to 'Y', I don't understand why it should be compared to 'N' and not to 'Y' like the other blocks. Also, I noticed in this same file: 1252 sal_Int32 SAL_CALL ODatabaseMetaData::getDefaultTransactionIsolation( ) throw(SQLException, RuntimeException, std::exception) 1253 { 1254 SQLUINTEGER nValue; 1255 OTools::GetInfo(m_pConnection,m_aConnectionHandle,SQL_SUBQUERIES,nValue,*this); 1256 return nValue; 1257 } Searching about getDefaultTransactionIsolation, I found SQL_DEFAULT_TXN_ISOLATION. But this attribute isn't in sqlext.h but in isqlext.h (see http://sourcecodebrowser.com/unixodbc/2.2.11/nn_2isqlext_8h.html) Nevertheless, looking the number of locations where sqlext.h is used in LO, I wonder what impact would be including isqlext.h Still, the above code with SQL_SUBQUERIES seems weird. Any idea? Julien -- View this message in context: http://nabble.documentfoundation.org/About-parts-in-ODatabaseMetaData-cxx-connectivy-module-odbc-part-tp4104005.html Sent from the Dev mailing list archive at Nabble.com. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice