Tag: cws_src680_dba24c
User: fs      
Date: 2007-10-29 22:12:38+0000
Modified:
   dba/connectivity/inc/connectivity/sqlnode.hxx
   dba/connectivity/inc/connectivity/virtualdbtools.hxx
   dba/connectivity/source/commontools/DateConversion.cxx
   dba/connectivity/source/drivers/ado/AStatement.cxx
   dba/connectivity/source/drivers/file/fanalyzer.cxx
   dba/connectivity/source/drivers/file/fcomp.cxx
   dba/connectivity/source/drivers/jdbc/JConnection.cxx
   dba/connectivity/source/drivers/odbc/OPreparedStatement.cxx
   dba/connectivity/source/inc/sqlscan.hxx
   dba/connectivity/source/inc/odbc/OBoundParam.hxx
   dba/connectivity/source/inc/odbc/OPreparedStatement.hxx
   dba/connectivity/source/parse/sqlbison.y
   dba/connectivity/source/parse/sqlflex.l
   dba/connectivity/source/parse/sqlnode.cxx
   dba/connectivity/source/simpledbt/dbtfactory.cxx
   dba/connectivity/source/simpledbt/dbtfactory.hxx

Log:
 merging changes from CWS dba24b herein, to not wait for later resync

File Changes:

Directory: /dba/connectivity/inc/connectivity/
==============================================

File [changed]: sqlnode.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/inc/connectivity/sqlnode.hxx?r1=1.20&r2=1.20.96.1
Delta lines:  +4 -4
-------------------
--- sqlnode.hxx 2006-12-13 16:12:16+0000        1.20
+++ sqlnode.hxx 2007-10-29 22:12:32+0000        1.20.96.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: sqlnode.hxx,v $
  *
- *  $Revision: 1.20 $
+ *  $Revision: 1.20.96.1 $
  *
- *  last change: $Author: kz $ $Date: 2006/12/13 16:12:16 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:32 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -86,7 +86,7 @@
                                                 SQL_NODE_KEYWORD, 
SQL_NODE_COMPARISON, SQL_NODE_NAME,
                                                 SQL_NODE_STRING,       
SQL_NODE_INTNUM, SQL_NODE_APPROXNUM,
                                                 
SQL_NODE_EQUAL,SQL_NODE_LESS,SQL_NODE_GREAT,SQL_NODE_LESSEQ,SQL_NODE_GREATEQ,SQL_NODE_NOTEQUAL,
-                                                SQL_NODE_PUNCTUATION, 
SQL_NODE_AMMSC, SQL_NODE_ACCESS_DATE,SQL_NODE_DATE};
+                                                SQL_NODE_PUNCTUATION, 
SQL_NODE_AMMSC, SQL_NODE_ACCESS_DATE,SQL_NODE_DATE,SQL_NODE_CONCAT};
 
     typedef ::std::set< ::rtl::OUString >   QueryNameSet;
     //==================================================================

File [changed]: virtualdbtools.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/inc/connectivity/virtualdbtools.hxx?r1=1.13&r2=1.13.96.1
Delta lines:  +16 -3
--------------------
--- virtualdbtools.hxx  2006-12-13 16:12:30+0000        1.13
+++ virtualdbtools.hxx  2007-10-29 22:12:33+0000        1.13.96.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: virtualdbtools.hxx,v $
  *
- *  $Revision: 1.13 $
+ *  $Revision: 1.13.96.1 $
  *
- *  last change: $Author: kz $ $Date: 2006/12/13 16:12:30 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:33 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -54,7 +54,9 @@
 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ 
 #include <com/sun/star/uno/Sequence.hxx>
 #endif
+
 #include <vector>
+#include <memory>
 
 //========================================================================
 //= forward declarations
@@ -95,6 +97,11 @@
 
 namespace dbtools {
        class SQLExceptionInfo;
+    class FormattedColumnValue;
+}
+
+namespace comphelper {
+    class ComponentContext;
 }
 
 //========================================================================
@@ -347,6 +354,12 @@
 
                        /// creates a helper which can be used to access the 
static methods in dbtools.hxx
                        virtual ::rtl::Reference< IDataAccessTools > 
getDataAccessTools() = 0;
+
+            virtual ::std::auto_ptr< ::dbtools::FormattedColumnValue >  
createFormattedColumnValue(
+                const ::comphelper::ComponentContext& _rContext,
+                const ::com::sun::star::uno::Reference< 
::com::sun::star::sdbc::XRowSet >& _rxRowSet,
+                const ::com::sun::star::uno::Reference< 
::com::sun::star::beans::XPropertySet >& _rxColumn
+            ) = 0;
                };
 
        //....................................................................

Directory: /dba/connectivity/source/commontools/
================================================

File [changed]: DateConversion.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/DateConversion.cxx?r1=1.16&r2=1.16.132.1
Delta lines:  +4 -4
-------------------
--- DateConversion.cxx  2006-09-17 01:57:56+0000        1.16
+++ DateConversion.cxx  2007-10-29 22:12:33+0000        1.16.132.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: DateConversion.cxx,v $
  *
- *  $Revision: 1.16 $
+ *  $Revision: 1.16.132.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/09/17 01:57:56 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:33 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -242,7 +242,7 @@
                                // einfache Nummer dar -> anpassen
                                ::rtl::OUString sExpanded(rString);
                                static ::rtl::OUString s_sPercentSymbol = 
::rtl::OUString::createFromAscii("%");
-                                       // need a method to add a sal_Unicode 
to a string, 'til then we use a static string const Exception&
+                                       // need a method to add a sal_Unicode 
to a string, 'til then we use a static string
                                sExpanded += s_sPercentSymbol;
                                fValue = 
xFormatter->convertStringToNumber(nKeyToUse, sExpanded);
                        }

Directory: /dba/connectivity/source/drivers/ado/
================================================

File [changed]: AStatement.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/ado/AStatement.cxx?r1=1.26&r2=1.26.58.1
Delta lines:  +5 -3
-------------------
--- AStatement.cxx      2007-03-26 13:58:00+0000        1.26
+++ AStatement.cxx      2007-10-29 22:12:33+0000        1.26.58.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: AStatement.cxx,v $
  *
- *  $Revision: 1.26 $
+ *  $Revision: 1.26.58.1 $
  *
- *  last change: $Author: vg $ $Date: 2007/03/26 13:58:00 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:33 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -842,6 +842,8 @@
                        rValue <<= getFetchSize();
                        break;
                case PROPERTY_ID_ESCAPEPROCESSING:
+            rValue <<= sal_True;
+            break;
                case PROPERTY_ID_USEBOOKMARKS:
                default:
                        ;

Directory: /dba/connectivity/source/drivers/file/
=================================================

File [changed]: fanalyzer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/file/fanalyzer.cxx?r1=1.24&r2=1.24.132.1
Delta lines:  +4 -4
-------------------
--- fanalyzer.cxx       2006-09-17 02:35:18+0000        1.24
+++ fanalyzer.cxx       2007-10-29 22:12:33+0000        1.24.132.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: fanalyzer.cxx,v $
  *
- *  $Revision: 1.24 $
+ *  $Revision: 1.24.132.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/09/17 02:35:18 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:33 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -117,7 +117,7 @@
                                }
                                else if ( ( 
SQL_ISRULE(pColumnRef,general_set_fct) && pColumnRef->count() != 4 ) )
                                {
-                                       
::dbtools::throwGenericSQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Statement
 to complex. Only \"COUNT(*)\" is supported.")),NULL);
+                                       
::dbtools::throwGenericSQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Statement
 too complex. Only \"COUNT(*)\" is supported.")),NULL);
                                }
                                else
                                        m_aSelectionEvaluations.push_back( 
TPredicates() );

File [changed]: fcomp.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/file/fcomp.cxx?r1=1.27&r2=1.27.2.1
Delta lines:  +7 -7
-------------------
--- fcomp.cxx   2007-09-26 14:29:12+0000        1.27
+++ fcomp.cxx   2007-10-29 22:12:33+0000        1.27.2.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: fcomp.cxx,v $
  *
- *  $Revision: 1.27 $
+ *  $Revision: 1.27.2.1 $
  *
- *  last change: $Author: hr $ $Date: 2007/09/26 14:29:12 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:33 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -146,7 +146,7 @@
                                OSQLParseNode *pColumnRef = 
pSelection->getChild(i)->getChild(0);
                                if ( SQL_ISRULE(pColumnRef,general_set_fct) && 
pColumnRef->count() != 4 )
                                {
-                                       
::dbtools::throwGenericSQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Statement
 to complex. Only \"COUNT(*)\" is supported.")),NULL);
+                                       
::dbtools::throwGenericSQLException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Statement
 too complex. Only \"COUNT(*)\" is supported.")),NULL);
                                }
                        }
                }
@@ -287,7 +287,7 @@
                  // upper, lower etc.
                  SQL_ISRULE(pPredicateNode->getChild(2),fold)) )
        {
-               
::dbtools::throwGenericSQLException(::rtl::OUString::createFromAscii("Statement 
to complex"),NULL);
+               
::dbtools::throwGenericSQLException(::rtl::OUString::createFromAscii("Statement 
too complex"),NULL);
                return NULL;
        }
 
@@ -614,7 +614,7 @@
                        }
                }
                else
-                       
::dbtools::throwGenericSQLException(::rtl::OUString::createFromAscii("Statement 
to complex"),NULL);
+                       
::dbtools::throwGenericSQLException(::rtl::OUString::createFromAscii("Statement 
too complex"),NULL);
 
        }
        else if( SQL_ISRULE(pPredicateNode,fold) )
@@ -634,7 +634,7 @@
        }
        else
        {
-               
::dbtools::throwGenericSQLException(::rtl::OUString::createFromAscii("Statement 
to complex"),NULL);
+               
::dbtools::throwGenericSQLException(::rtl::OUString::createFromAscii("Statement 
too complex"),NULL);
        }
        if (pOperand)
                m_aCodeList.push_back(pOperand);

Directory: /dba/connectivity/source/drivers/jdbc/
=================================================

File [changed]: JConnection.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/jdbc/JConnection.cxx?r1=1.6.2.5&r2=1.6.2.6
Delta lines:  +3 -2
-------------------
--- JConnection.cxx     2007-10-29 10:59:19+0000        1.6.2.5
+++ JConnection.cxx     2007-10-29 22:12:33+0000        1.6.2.6
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: JConnection.cxx,v $
  *
- *  $Revision: 1.6.2.5 $
+ *  $Revision: 1.6.2.6 $
  *
- *  last change: $Author: fs $ $Date: 2007/10/29 10:59:19 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:33 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1024,6 +1024,7 @@
             if ( !aStr.getLength() )
             {
                 m_aLogger.log( LogLevel::SEVERE, STR_LOG_NO_DRIVER_CLASS );
+                throw SQLException(::rtl::OUString::createFromAscii("The 
specified driver was empty!"),*this,::rtl::OUString(),1000,Any());
             }
             else
             {

Directory: /dba/connectivity/source/drivers/odbc/
=================================================

File [changed]: OPreparedStatement.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/odbc/OPreparedStatement.cxx?r1=1.44&r2=1.44.2.1
Delta lines:  +9 -8
-------------------
--- OPreparedStatement.cxx      2007-09-26 14:30:18+0000        1.44
+++ OPreparedStatement.cxx      2007-10-29 22:12:34+0000        1.44.2.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: OPreparedStatement.cxx,v $
  *
- *  $Revision: 1.44 $
+ *  $Revision: 1.44.2.1 $
  *
- *  last change: $Author: hr $ $Date: 2007/09/26 14:30:18 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:34 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -104,9 +104,9 @@
 OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const 
TTypeInfoVector& _TypeInfo,const ::rtl::OUString& sql)
        :OStatement_BASE2(_pConnection)
        ,m_aTypeInfo(_TypeInfo)
+    ,numParams(0)
        ,boundParams(NULL)
        ,m_bPrepared(sal_False)
-
 {
        m_sSqlStatement = sql;
        try
@@ -661,7 +661,7 @@
        OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
        // Get the number of parameters
        numParams = 0;
-       N3SQLNumParams (m_aStatementHandle,(short*)&numParams);
+       N3SQLNumParams (m_aStatementHandle,&numParams);
 
        // There are parameter markers, allocate the bound
        // parameter objects
@@ -696,7 +696,7 @@
        // Sanity check the parameter number
 
        if ((index >= 1) &&
-               (index <= numParams))
+               (index <= numParams) && bufLen > 0 )
        {
                b = boundParams[index - 1].allocBindDataBuffer(bufLen);
        }
@@ -979,6 +979,7 @@
 
 void OPreparedStatement::FreeParams()
 {
+    numParams = 0;
        delete [] boundParams;
        boundParams = NULL;
 }
@@ -1019,11 +1020,11 @@
 {
        if(!isPrepared())
        {
-               m_bPrepared = sal_True;
                OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
                ::rtl::OString 
aSql(::rtl::OUStringToOString(m_sSqlStatement,getOwnConnection()->getTextEncoding()));
                SQLRETURN nReturn = 
N3SQLPrepare(m_aStatementHandle,(SDB_ODBC_CHAR *) 
aSql.getStr(),aSql.getLength());
                
OTools::ThrowException(m_pConnection,nReturn,m_aStatementHandle,SQL_HANDLE_STMT,*this);
+        m_bPrepared = sal_True;
                initBoundParam();
        }
 }

Directory: /dba/connectivity/source/inc/
========================================

File [changed]: sqlscan.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/inc/sqlscan.hxx?r1=1.8&r2=1.8.192.1
Delta lines:  +4 -3
-------------------
--- sqlscan.hxx 2006-06-20 01:58:58+0000        1.8
+++ sqlscan.hxx 2007-10-29 22:12:34+0000        1.8.192.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: sqlscan.hxx,v $
  *
- *  $Revision: 1.8 $
+ *  $Revision: 1.8.192.1 $
  *
- *  last change: $Author: hr $ $Date: 2006/06/20 01:58:58 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:34 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -93,6 +93,7 @@
                sal_Int32       GetSQLRule() const;
                sal_Int32       GetDATERule() const;
                sal_Int32       GetSTRINGRule() const;
+        inline sal_Int32 GetCurrentPos() const { return m_nCurrentPos; }
        };
 }
 

Directory: /dba/connectivity/source/inc/odbc/
=============================================

File [changed]: OBoundParam.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/inc/odbc/OBoundParam.hxx?r1=1.3&r2=1.3.290.1
Delta lines:  +5 -3
-------------------
--- OBoundParam.hxx     2005-09-08 07:34:29+0000        1.3
+++ OBoundParam.hxx     2007-10-29 22:12:34+0000        1.3.290.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: OBoundParam.hxx,v $
  *
- *  $Revision: 1.3 $
+ *  $Revision: 1.3.290.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 07:34:29 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:34 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -86,6 +86,8 @@
                        
//--------------------------------------------------------------------
                        sal_Int8* allocBindDataBuffer (sal_Int32 bufLen)
                        {
+                if ( binaryData )
+                    delete [] binaryData;
                                binaryData = new sal_Int8[bufLen];
 
                                // Reset the input stream, we are doing a new 
bind

File [changed]: OPreparedStatement.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/inc/odbc/OPreparedStatement.hxx?r1=1.12&r2=1.12.2.1
Delta lines:  +4 -4
-------------------
--- OPreparedStatement.hxx      2007-09-26 14:30:59+0000        1.12
+++ OPreparedStatement.hxx      2007-10-29 22:12:34+0000        1.12.2.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: OPreparedStatement.hxx,v $
  *
- *  $Revision: 1.12 $
+ *  $Revision: 1.12.2.1 $
  *
- *  last change: $Author: hr $ $Date: 2007/09/26 14:30:59 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:34 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -97,7 +97,7 @@
                                                                                
                                                                //  for each 
row returned by
                                                                                
                                                                //  
DatabaseMetaData.getTypeInfo.
 
-                       int                             numParams;              
// Number of parameter markers
+                       SQLSMALLINT     numParams;              // Number of 
parameter markers
                                                                                
        //  for the prepared statement
 
                        OBoundParam*    boundParams;

Directory: /dba/connectivity/source/parse/
==========================================

File [changed]: sqlbison.y
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqlbison.y?r1=1.57.18.3&r2=1.57.18.4
Delta lines:  +29 -42
---------------------
--- sqlbison.y  2007-09-28 22:04:18+0000        1.57.18.3
+++ sqlbison.y  2007-10-29 22:12:34+0000        1.57.18.4
@@ -1,7 +1,7 @@
 %{
 //--------------------------------------------------------------------------
 //
-// $Header: /cvs/dba/connectivity/source/parse/sqlbison.y,v 1.57.18.3 
2007/09/28 22:04:18 fs Exp $
+// $Header: /cvs/dba/connectivity/source/parse/sqlbison.y,v 1.57.18.4 
2007/10/29 22:12:34 fs Exp $
 //
 // Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
 //
@@ -9,7 +9,7 @@
 //     OJ
 //
 // Last change:
-//     $Author: fs $ $Date: 2007/09/28 22:04:18 $ $Revision: 1.57.18.3 $
+//     $Author: fs $ $Date: 2007/10/29 22:12:34 $ $Revision: 1.57.18.4 $
 //
 // Description:
 //
@@ -204,7 +204,7 @@
 %left <pParseNode> SQL_TOKEN_AND
 
 %left <pParseNode> SQL_LESSEQ SQL_GREATEQ SQL_NOTEQUAL SQL_LESS SQL_GREAT 
SQL_EQUAL /* '<' '>' = <> < > <= >= != */
-%left <pParseNode> '+' '-'
+%left <pParseNode> '+' '-' SQL_CONCAT
 %left <pParseNode> '*' '/'
 %left SQL_TOKEN_NATURAL SQL_TOKEN_CROSS SQL_TOKEN_FULL SQL_TOKEN_LEFT 
SQL_TOKEN_RIGHT
 %left ')'
@@ -1013,9 +1013,15 @@
                column_ref
                        {$$ = SQL_NEW_COMMALISTRULE;
                        $$->append($1);}
+       |       set_fct_spec
+               {$$ = SQL_NEW_COMMALISTRULE;
+                       $$->append($1);}
        |       column_ref_commalist ',' column_ref
                        {$1->append($3);
                        $$ = $1;}
+       |   column_ref_commalist ',' set_fct_spec
+                       {$1->append($3);
+                       $$ = $1;}
        ;
 
 opt_having_clause:
@@ -1045,14 +1051,7 @@
 
 boolean_test:
                boolean_primary
-       |       boolean_primary SQL_TOKEN_IS truth_value
-               {
-                       $$ = SQL_NEW_RULE;
-                       $$->append($1);
-                       $$->append($2);
-                       $$->append($3);
-               }
-       |       boolean_primary SQL_TOKEN_IS SQL_TOKEN_NOT truth_value %prec 
SQL_TOKEN_IS
+       |       boolean_primary SQL_TOKEN_IS sql_not truth_value
                {
                        $$ = SQL_NEW_RULE;
                        $$->append($1);
@@ -1060,39 +1059,14 @@
                        $$->append($3);
                        $$->append($4);
                }
-/*     |       sql_not SQL_TOKEN_LIKE string_value_exp opt_escape
-               {
-                       if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
-                       {
-                               OSQLParseNode* pColumnRef = 
newNode(aEmptyString, 
SQL_NODE_RULE,OSQLParser::RuleID(OSQLParseNode::column_ref));
-                               
pColumnRef->append(newNode(xxx_pGLOBAL_SQLPARSER->getFieldName(),SQL_NODE_NAME));
-
-                               $$ = SQL_NEW_RULE;
-                               $$->append(pColumnRef);
-                               $$->append($1);
-                               $$->append($2);
-                               if 
(xxx_pGLOBAL_SQLPARSER->buildLikeRule($$,$3,$4))
-                                       $$->append($4);
-                               else
-                               {
-                                       delete $$;
-                                       YYABORT;
-                               }
-                       }
-                       else
-                               YYERROR;
-               }
-*/
        ;
 boolean_factor:
                boolean_test
-       |       SQL_TOKEN_NOT '(' boolean_test ')'
+       |       SQL_TOKEN_NOT boolean_test
                {
                        $$ = SQL_NEW_RULE;
                        $$->append($1);
-                       $$->append($2 = newNode("(", SQL_NODE_PUNCTUATION));
-                       $$->append($3);
-                       $$->append($4 = newNode(")", SQL_NODE_PUNCTUATION));
+                       $$->append($2);
                }
        ;
 boolean_term:
@@ -1409,6 +1383,7 @@
                                $$->append($1);
                                $$->append($2);
                                $$->append($3);
+                               // hello
                        }
                        else
                                YYERROR;
@@ -2646,6 +2621,13 @@
                        $$->append($2 = newNode("+", SQL_NODE_PUNCTUATION));
                        $$->append($3);
                }
+       |       value_exp SQL_CONCAT value_exp
+               {
+                       $$ = SQL_NEW_RULE;
+                       $$->append($1);
+                       $$->append($2);
+                       $$->append($3);
+               }
        ;
 
 char_primary:
@@ -3076,7 +3058,7 @@
                        $$->append($1 = newNode(":", SQL_NODE_PUNCTUATION));
                        $$->append($2);}
        |       '?'
-                       {$$ = SQL_NEW_RULE;
+                       {$$ = SQL_NEW_RULE; // test
                        $$->append($1 = newNode("?", SQL_NODE_PUNCTUATION));}
        |       '['     SQL_TOKEN_NAME ']'
                        {$$ = SQL_NEW_RULE;
@@ -3105,6 +3087,11 @@
                        if (xxx_pGLOBAL_SQLPARSER->inPredicateCheck())
                        {
                                $$ = $1;
+                               if ( SQL_ISRULE($$,search_condition) )
+                               {
+                                       $$->insert(0,newNode("(", 
SQL_NODE_PUNCTUATION));
+                                       $$->append(newNode(")", 
SQL_NODE_PUNCTUATION));
+                               }
                        }
                        else
                                YYERROR;

File [changed]: sqlflex.l
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqlflex.l?r1=1.31&r2=1.31.2.1
Delta lines:  +6 -7
-------------------
--- sqlflex.l   2007-09-26 14:31:39+0000        1.31
+++ sqlflex.l   2007-10-29 22:12:34+0000        1.31.2.1
@@ -6,9 +6,9 @@
 //
 //  $RCSfile: sqlflex.l,v $
 //
-//  $Revision: 1.31 $
+//  $Revision: 1.31.2.1 $
 //
-//  last change: $Author: hr $ $Date: 2007/09/26 14:31:39 $
+//  last change: $Author: fs $ $Date: 2007/10/29 22:12:34 $
 //
 //  The Contents of this file are made available subject to
 //  the terms of GNU Lesser General Public License Version 2.1.
@@ -250,7 +250,6 @@
 [Ll][Oo][Gg][Ff]                                                               
{SQL_NEW_KEYWORD(SQL_TOKEN_LOGF); return SQL_TOKEN_LOGF; }
 [Ll][Oo][Gg]10                                                                 
{SQL_NEW_KEYWORD(SQL_TOKEN_LOG10); return SQL_TOKEN_LOG10; }
 [Ll][Oo][Ww][Ee][Rr]                                                   
{SQL_NEW_KEYWORD(SQL_TOKEN_LOWER); return SQL_TOKEN_LOWER; }
-[Ll][Nn]                                                                       
        {SQL_NEW_KEYWORD(SQL_TOKEN_LN); return SQL_TOKEN_LN; }
 [Ll][Tt][Rr][Ii][Mm]                                                   
{SQL_NEW_KEYWORD(SQL_TOKEN_LTRIM); return SQL_TOKEN_LTRIM; }
 
 [Mm][Aa][Xx]                                                                   
{SQL_NEW_KEYWORD(SQL_TOKEN_MAX); return SQL_TOKEN_MAX; }
@@ -361,12 +360,12 @@
 ">="                           { 
SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8),
 SQL_NODE_GREATEQ);return SQL_GREATEQ;}
 "<>"                           { 
SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8),
 SQL_NODE_NOTEQUAL);return SQL_NOTEQUAL;}
 "!="                           { 
SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8),
 SQL_NODE_NOTEQUAL);return SQL_NOTEQUAL;}
+"||"                           { 
SQL_NEW_NODE(::rtl::OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8),
 SQL_NODE_CONCAT);return SQL_CONCAT;}
 
 
 [-+*/:(),.;?{}]    { return SQLyytext[0]; }
 
 
-
 
<SQL>[A-Za-z\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375][A-Za-z\200-\277\300-\337\340-\357\360-\367\370-\373\374-\375_0-9]*
         {return gatherName( SQLyytext);}
 
 <SQL>([0-9]+) | 
@@ -621,7 +620,7 @@
                {
                        ::rtl::OString sStmt = 
xxx_pGLOBAL_SQLSCAN->getStatement();
                        sal_Int32 nLength = strlen(text);
-                       sal_Int32 nPos = sStmt.getLength() - nLength - 1;
+                       sal_Int32 nPos = xxx_pGLOBAL_SQLSCAN->GetCurrentPos() - 
nLength - 2;
                        if (sStmt.getStr()[nPos] == ':')
                        {
                                
SQL_NEW_NODE(::rtl::OUString(text,nLength,RTL_TEXTENCODING_UTF8), 
SQL_NODE_NAME); 

File [changed]: sqlnode.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqlnode.cxx?r1=1.47.34.3&r2=1.47.34.4
Delta lines:  +27 -24
---------------------
--- sqlnode.cxx 2007-09-28 22:04:18+0000        1.47.34.3
+++ sqlnode.cxx 2007-10-29 22:12:34+0000        1.47.34.4
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: sqlnode.cxx,v $
  *
- *  $Revision: 1.47.34.3 $
+ *  $Revision: 1.47.34.4 $
  *
- *  last change: $Author: fs $ $Date: 2007/09/28 22:04:18 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:34 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -549,7 +549,7 @@
 
                        m_aChilds[0]->impl_parseNodeToString_throw( rString, 
aNewParam );
                        aNewParam.bQuote = rParam.bQuote;
-                       aNewParam.bPredicate = sal_False; // disable [ ] around 
names
+                       //aNewParam.bPredicate = sal_False; // disable [ ] 
around names // look at i73215 
                        ::rtl::OUString aStringPara;
                        for (sal_uInt32 i=1; i<nCount; i++)
                        {
@@ -797,7 +797,7 @@
        const OSQLParseNode* pParaNode = NULL;
 
        SQLParseNodeParameter aNewParam(rParam);
-       aNewParam.bQuote = sal_True;
+       //aNewParam.bQuote = sal_True; // why setting this to true? @see 
http://www.openoffice.org/issues/show_bug.cgi?id=75557
 
        // if there is a field given we don't display the fieldname, if there 
are any
        sal_Bool bAddName = sal_True;
@@ -1669,7 +1669,7 @@
         ,m_nNodeID(nNewNodeID)
 {
 
-    OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= 
SQL_NODE_ACCESS_DATE,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
+    OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= 
SQL_NODE_CONCAT,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
 }
 //-----------------------------------------------------------------------------
 OSQLParseNode::OSQLParseNode(const ::rtl::OString &_rNewValue,
@@ -1681,7 +1681,7 @@
         ,m_nNodeID(nNewNodeID)
 {
 
-    OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= 
SQL_NODE_ACCESS_DATE,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
+    OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= 
SQL_NODE_CONCAT,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
 }
 //-----------------------------------------------------------------------------
 OSQLParseNode::OSQLParseNode(const sal_Unicode * pNewValue,
@@ -1693,7 +1693,7 @@
         ,m_nNodeID(nNewNodeID)
 {
 
-    OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= 
SQL_NODE_ACCESS_DATE,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
+    OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= 
SQL_NODE_CONCAT,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
 }
 //-----------------------------------------------------------------------------
 OSQLParseNode::OSQLParseNode(const ::rtl::OUString &_rNewValue,
@@ -1705,7 +1705,7 @@
         ,m_nNodeID(nNewNodeID)
 {
 
-    OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= 
SQL_NODE_ACCESS_DATE,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
+    OSL_ENSURE(m_eNodeType >= SQL_NODE_RULE && m_eNodeType <= 
SQL_NODE_CONCAT,"OSQLParseNode: mit unzulaessigem NodeType konstruiert");
 }
 //-----------------------------------------------------------------------------
 OSQLParseNode::OSQLParseNode(const OSQLParseNode& rParseNode)
@@ -1929,6 +1929,8 @@
         else if(pRight->count() == 3 && SQL_ISRULE(pRight,boolean_primary) && 
SQL_ISRULE(pRight->getChild(1),search_condition))
         {
             // and-or tree  on right side
+            if ( pRight->getChild(1)->getByRule(OSQLParseNode::boolean_term) )
+            {
             OSQLParseNode* pOr = pRight->getChild(1);
             OSQLParseNode* pNewLeft = NULL;
             OSQLParseNode* pNewRight = NULL;
@@ -1944,6 +1946,7 @@
             replaceAndReset(pSearchCondition,pNewNode);
             disjunctiveNormalForm(pSearchCondition);
         }
+        }
         else if(SQL_ISRULE(pLeft,boolean_primary) && 
(!SQL_ISRULE(pLeft->getChild(1),search_condition) || 
!SQL_ISRULE(pLeft->getChild(1),boolean_term)))
             pSearchCondition->replace(pLeft, pLeft->removeAt(1));
         else if(SQL_ISRULE(pRight,boolean_primary) && 
(!SQL_ISRULE(pRight->getChild(1),search_condition) || 
!SQL_ISRULE(pRight->getChild(1),boolean_term)))
@@ -2006,7 +2009,7 @@
     {
         OSQLParseNode *pNot = pSearchCondition->removeAt((sal_uInt32)0);
         delete pNot;
-        OSQLParseNode *pBooleanTest = 
pSearchCondition->removeAt((sal_uInt32)1);
+        OSQLParseNode *pBooleanTest = 
pSearchCondition->removeAt((sal_uInt32)0);
         pBooleanTest->setParent(NULL);
         replaceAndReset(pSearchCondition,pBooleanTest);
 
@@ -2144,7 +2147,7 @@
             pNewNode = pSearchCondition->removeAt((sal_uInt32)2);
             replaceAndReset(pSearchCondition,pNewNode);
         }
-        else
+        else if ( p2ndSearch->getByRule(OSQLParseNode::boolean_term) )
         {
             // a and ( b or c ) -> ( a and b ) or ( a and c )
             // ( b or c ) and a -> ( a and b ) or ( a and c )

Directory: /dba/connectivity/source/simpledbt/
==============================================

File [changed]: dbtfactory.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/simpledbt/dbtfactory.cxx?r1=1.6&r2=1.6.132.1
Delta lines:  +14 -6
--------------------
--- dbtfactory.cxx      2006-09-17 03:13:30+0000        1.6
+++ dbtfactory.cxx      2007-10-29 22:12:35+0000        1.6.132.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbtfactory.cxx,v $
  *
- *  $Revision: 1.6 $
+ *  $Revision: 1.6.132.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/09/17 03:13:30 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:35 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -36,12 +36,12 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_connectivity.hxx"
 
+#include <connectivity/virtualdbtools.hxx>
+#include <connectivity/formattedcolumnvalue.hxx>
+
 #ifndef CONNECTIVITY_DBTOOLS_DBTFACTORY_HXX
 #include "dbtfactory.hxx"
 #endif
-#ifndef CONNECTIVITY_VIRTUAL_DBTOOLS_HXX
-#include <connectivity/virtualdbtools.hxx>
-#endif
 #ifndef CONNECTIVITY_DBTOOLS_PARSER_SIMPLE_HXX
 #include "parser_s.hxx"
 #endif
@@ -111,6 +111,14 @@
        }
 
        //----------------------------------------------------------------
+    ::std::auto_ptr< ::dbtools::FormattedColumnValue > 
ODataAccessToolsFactory::createFormattedColumnValue( const 
::comphelper::ComponentContext& _rContext,
+        const Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet, const 
Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn )
+    {
+        ::std::auto_ptr< ::dbtools::FormattedColumnValue > pValue( new 
::dbtools::FormattedColumnValue( _rContext, _rxRowSet, _rxColumn ) );
+        return pValue;
+    }
+
+       //----------------------------------------------------------------
        ::rtl::Reference< simple::ISQLParser > 
ODataAccessToolsFactory::createSQLParser(const Reference< XMultiServiceFactory 
>& _rxServiceFactory,const IParseContext* _pContext) const
        {
                return new OSimpleSQLParser(_rxServiceFactory,_pContext);

File [changed]: dbtfactory.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/simpledbt/dbtfactory.hxx?r1=1.5&r2=1.5.290.1
Delta lines:  +9 -3
-------------------
--- dbtfactory.hxx      2005-09-08 07:46:39+0000        1.5
+++ dbtfactory.hxx      2007-10-29 22:12:35+0000        1.5.290.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbtfactory.hxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.5.290.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 07:46:39 $
+ *  last change: $Author: fs $ $Date: 2007/10/29 22:12:35 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -74,6 +74,12 @@
 
                virtual ::rtl::Reference< simple::IDataAccessTools > 
getDataAccessTools();
 
+        virtual ::std::auto_ptr< ::dbtools::FormattedColumnValue >  
createFormattedColumnValue(
+            const ::comphelper::ComponentContext& _rContext,
+            const ::com::sun::star::uno::Reference< 
::com::sun::star::sdbc::XRowSet >& _rxRowSet,
+            const ::com::sun::star::uno::Reference< 
::com::sun::star::beans::XPropertySet >& _rxColumn
+        );
+
                // IReference
                virtual oslInterlockedCount SAL_CALL acquire();
                virtual oslInterlockedCount SAL_CALL release();




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to