Tag: cws_src680_dba24a
User: oj      
Date: 2007-08-06 07:26:54+0000
Modified:
   dba/connectivity/source/parse/sqlbison.y
   dba/connectivity/source/parse/sqlflex.l
   dba/connectivity/source/parse/sqlnode.cxx

Log:
 #i70081# impl datediff

File Changes:

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

File [changed]: sqlbison.y
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqlbison.y?r1=1.56&r2=1.56.56.1
Delta lines:  +7 -4
-------------------
--- sqlbison.y  2007-01-25 11:57:58+0000        1.56
+++ sqlbison.y  2007-08-06 07:26:51+0000        1.56.56.1
@@ -1,7 +1,7 @@
 %{
 //--------------------------------------------------------------------------
 //
-// $Header: /cvs/dba/connectivity/source/parse/sqlbison.y,v 1.56 2007/01/25 
11:57:58 obo Exp $
+// $Header: /cvs/dba/connectivity/source/parse/sqlbison.y,v 1.56.56.1 
2007/08/06 07:26:51 oj Exp $
 //
 // Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
 //
@@ -9,7 +9,7 @@
 //     OJ
 //
 // Last change:
-//     $Author: obo $ $Date: 2007/01/25 11:57:58 $ $Revision: 1.56 $
+//     $Author: oj $ $Date: 2007/08/06 07:26:51 $ $Revision: 1.56.56.1 $
 //
 // Description:
 //
@@ -188,7 +188,7 @@
 /* time and date functions */
 %token <pParseNode> SQL_TOKEN_CURRENT_DATE SQL_TOKEN_CURRENT_TIME 
SQL_TOKEN_CURRENT_TIMESTAMP SQL_TOKEN_CURDATE SQL_TOKEN_CURTIME          
 %token <pParseNode> SQL_TOKEN_DAYNAME  SQL_TOKEN_DAYOFMONTH  
SQL_TOKEN_DAYOFWEEK  SQL_TOKEN_DAYOFYEAR SQL_TOKEN_EXTRACT          
-%token <pParseNode> SQL_TOKEN_HOUR SQL_TOKEN_MINUTE  SQL_TOKEN_MONTH  
SQL_TOKEN_MONTHNAME SQL_TOKEN_NOW SQL_TOKEN_QUARTER          
+%token <pParseNode> SQL_TOKEN_HOUR SQL_TOKEN_MINUTE  SQL_TOKEN_MONTH  
SQL_TOKEN_MONTHNAME SQL_TOKEN_NOW SQL_TOKEN_QUARTER SQL_TOKEN_DATEDIFF
 %token <pParseNode> SQL_TOKEN_SECOND SQL_TOKEN_TIMESTAMPADD 
SQL_TOKEN_TIMESTAMPDIFF SQL_TOKEN_TIMEVALUE SQL_TOKEN_WEEK SQL_TOKEN_YEAR 
 
 /* numeric functions */
@@ -252,7 +252,7 @@
 %type <pParseNode> form_conversion char_translation trim_fct trim_operands 
trim_spec bit_value_fct bit_substring_fct op_column_commalist
 %type <pParseNode> /*bit_concatenation*/ bit_value_exp bit_factor bit_primary 
collate_clause char_value_fct unique_spec value_exp_commalist 
in_predicate_value unique_test update_source 
 %type <pParseNode> function_arg_commalist3 string_function_3Argument 
function_arg_commalist4 string_function_4Argument function_arg_commalist2 
string_function_1Argument string_function_2Argument
-%type <pParseNode> date_function_0Argument date_function_1Argument 
function_name12 function_name23 function_name1 function_name2 function_name3 
function_name0 numeric_function_0Argument numeric_function_1Argument 
numeric_function_2Argument
+%type <pParseNode> date_function_0Argument date_function_1Argument 
function_name12 function_name23 function_name1 function_name2 function_name3 
function_name0 numeric_function_0Argument numeric_function_1Argument 
numeric_function_2Argument date_function_3Argument
 %type <pParseNode> all query_primary as sql_not for_length upper_lower 
comparison column_val  cross_union /*opt_schema_element_list*/
 %type <pParseNode> /*op_authorization op_schema*/ nil_fkt schema_element 
base_table_def base_table_element base_table_element_commalist
 %type <pParseNode> column_def odbc_fct_spec    odbc_call_spec odbc_fct_type 
op_parameter union_statement
@@ -1850,6 +1850,7 @@
        ;
 function_name3:
                string_function_3Argument
+       |       date_function_3Argument
        ;
 function_name:
                string_function
@@ -1907,6 +1908,8 @@
        |       SQL_TOKEN_TIMEVALUE
        |       SQL_TOKEN_DATEVALUE
        ;
+date_function_3Argument:
+       SQL_TOKEN_DATEDIFF
        
 date_function:
                SQL_TOKEN_TIMESTAMPADD        

File [changed]: sqlflex.l
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqlflex.l?r1=1.30&r2=1.30.154.1
Delta lines:  +4 -3
-------------------
--- sqlflex.l   2006-07-25 07:45:46+0000        1.30
+++ sqlflex.l   2007-08-06 07:26:51+0000        1.30.154.1
@@ -6,9 +6,9 @@
 //
 //  $RCSfile: sqlflex.l,v $
 //
-//  $Revision: 1.30 $
+//  $Revision: 1.30.154.1 $
 //
-//  last change: $Author: rt $ $Date: 2006/07/25 07:45:46 $
+//  last change: $Author: oj $ $Date: 2007/08/06 07:26:51 $
 //
 //  The Contents of this file are made available subject to
 //  the terms of GNU Lesser General Public License Version 2.1.
@@ -183,6 +183,7 @@
 
 [Dd]                                                                           
        {SQL_NEW_KEYWORD(SQL_TOKEN_D); return SQL_TOKEN_D; }
 [Dd][Aa][Tt][Ee]                                                               
{SQL_NEW_KEYWORD(SQL_TOKEN_DATE); return SQL_TOKEN_DATE; }
+[Dd][Aa][Tt][Ee][Dd][Ii][Ff][Ff]                               
{SQL_NEW_KEYWORD(SQL_TOKEN_DATEDIFF); return SQL_TOKEN_DATEDIFF; }
 [Dd][Aa][Tt][Ee][Vv][Aa][Ll][Uu][Ee]                   
{SQL_NEW_KEYWORD(SQL_TOKEN_DATEVALUE); return SQL_TOKEN_DATEVALUE; }
 [Dd][Aa][Yy]                                                                   
{SQL_NEW_KEYWORD(SQL_TOKEN_DAY); return SQL_TOKEN_DAY; }
 [Dd][Aa][Yy][Nn][Aa][Mm][Ee]                                   
{SQL_NEW_KEYWORD(SQL_TOKEN_DAYNAME); return SQL_TOKEN_DAYNAME; }

File [changed]: sqlnode.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqlnode.cxx?r1=1.47&r2=1.47.20.1
Delta lines:  +4 -3
-------------------
--- sqlnode.cxx 2007-07-06 06:48:59+0000        1.47
+++ sqlnode.cxx 2007-08-06 07:26:51+0000        1.47.20.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: sqlnode.cxx,v $
  *
- *  $Revision: 1.47 $
+ *  $Revision: 1.47.20.1 $
  *
- *  last change: $Author: rt $ $Date: 2007/07/06 06:48:59 $
+ *  last change: $Author: oj $ $Date: 2007/08/06 07:26:51 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -2525,6 +2525,7 @@
     else 
if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CURRENT_TIME,pContext)))
         nType = DataType::TIME;
     else 
if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CURRENT_TIMESTAMP,pContext)))
    nType = DataType::TIMESTAMP;
     else 
if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CURDATE,pContext)))
              nType = DataType::DATE;
+    else 
if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DATEDIFF,pContext)))
             nType = DataType::INTEGER;
     else 
if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DATEVALUE,pContext)))
            nType = DataType::DATE;
     else 
if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_CURTIME,pContext)))
              nType = DataType::TIME;
     else 
if(sFunctionName.equalsIgnoreAsciiCase(TokenIDToStr(SQL_TOKEN_DAYNAME,pContext)))
              nType = DataType::VARCHAR;




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

Reply via email to