By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 782
Collapse All | Expand All

(-)koffice/chalk/core/tiles/kis_tileddatamanager.cc (-1 / +1 lines)
Lines 837-843 Link Here
837
{
837
{
838
    // Ahem, this is a bit not as good. The point is, this function needs the tile data,
838
    // Ahem, this is a bit not as good. The point is, this function needs the tile data,
839
    // but it might be swapped out. This code swaps it in, but at function exit it might
839
    // but it might be swapped out. This code swaps it in, but at function exit it might
840
    // be swapped out again! THIS MAKES THE RETURNED POINTER TQUITE VOLATILE
840
    // be swapped out again! THIS MAKES THE RETURNED POINTER QUITE VOLATILE
841
    return pixelPtrSafe(x, y, writable) -> data();
841
    return pixelPtrSafe(x, y, writable) -> data();
842
}
842
}
843
843
(-)koffice/filters/kword/mswrite/structures_generated.h (-1 / +1 lines)
Lines 70-76 Link Here
70
	// 
70
	// 
71
	// 	Structure Fields:
71
	// 	Structure Fields:
72
	// 
72
	// 
73
	// 		name #RETQUIRED
73
	// 		name #REQUIRED
74
	// 		type #IMPLIED "Word"
74
	// 		type #IMPLIED "Word"
75
	// 		default #IMPLIED ""
75
	// 		default #IMPLIED ""
76
	// 		description #IMPLIED ""	(also valid for Structures)
76
	// 		description #IMPLIED ""	(also valid for Structures)
(-)koffice/filters/olefilters/powerpoint97/pptSlide.cpp (-1 / +1 lines)
Lines 97-103 Link Here
97
	case OTHER_TEXT:
97
	case OTHER_TEXT:
98
	case CENTER_BODY_TEXT:
98
	case CENTER_BODY_TEXT:
99
	case HALF_BODY_TEXT:
99
	case HALF_BODY_TEXT:
100
	case TQUARTER_BODY_TEXT:
100
	case QUARTER_BODY_TEXT:
101
	        TQStringList data(TQStringList::split(TQChar('\r'), text, true));
101
	        TQStringList data(TQStringList::split(TQChar('\r'), text, true));
102
		for (j = 0; j < data.count(); j++)
102
		for (j = 0; j < data.count(); j++)
103
		{
103
		{
(-)koffice/filters/olefilters/powerpoint97/pptSlide.h (-1 / +1 lines)
Lines 38-44 Link Here
38
#define CENTER_BODY_TEXT 	5	//center body(subtitle in title slide)
38
#define CENTER_BODY_TEXT 	5	//center body(subtitle in title slide)
39
#define CENTER_TITLE_TEXT 	6	//center title(title in title slide)
39
#define CENTER_TITLE_TEXT 	6	//center title(title in title slide)
40
#define HALF_BODY_TEXT 	7	//half body(body in two-column slide)
40
#define HALF_BODY_TEXT 	7	//half body(body in two-column slide)
41
#define TQUARTER_BODY_TEXT 	8	//quarter body(body in four-body slide)
41
#define QUARTER_BODY_TEXT 	8	//quarter body(body in four-body slide)
42
//--
42
//--
43
43
44
//--char style types
44
//--char style types
(-)koffice/filters/olefilters/powerpoint97/pptdoc.cc (-1 / +1 lines)
Lines 68-74 Link Here
68
	case OTHER_TEXT:
68
	case OTHER_TEXT:
69
	case CENTER_BODY_TEXT:
69
	case CENTER_BODY_TEXT:
70
	case HALF_BODY_TEXT:
70
	case HALF_BODY_TEXT:
71
	case TQUARTER_BODY_TEXT:
71
	case QUARTER_BODY_TEXT:
72
		for (j = 0; j < data.count(); j++)
72
		for (j = 0; j < data.count(); j++)
73
		{
73
		{
74
			ourSlide.body.append(data[j]);
74
			ourSlide.body.append(data[j]);
(-)koffice/filters/olefilters/powerpoint97/pptxml.cc (-1 / +1 lines)
Lines 258-264 Link Here
258
		break;
258
		break;
259
	case OTHER_TEXT:
259
	case OTHER_TEXT:
260
	case HALF_BODY_TEXT:
260
	case HALF_BODY_TEXT:
261
	case TQUARTER_BODY_TEXT:
261
	case QUARTER_BODY_TEXT:
262
		y = 130;
262
		y = 130;
263
		if(m_half)
263
		if(m_half)
264
		{
264
		{
(-)koffice/kexi/3rdparty/kexisql/src/build.c (-5 / +5 lines)
Lines 526-532 Link Here
526
  /* Begin generating the code that will insert the table record into
526
  /* Begin generating the code that will insert the table record into
527
  ** the SQLITE_MASTER table.  Note in particular that we must go ahead
527
  ** the SQLITE_MASTER table.  Note in particular that we must go ahead
528
  ** and allocate the record number for the table entry now.  Before any
528
  ** and allocate the record number for the table entry now.  Before any
529
  ** PRIMARY KEY or UNITQUE keywords are parsed.  Those keywords will cause
529
  ** PRIMARY KEY or UNIQUE keywords are parsed.  Those keywords will cause
530
  ** indices to be created and the table record must come before the 
530
  ** indices to be created and the table record must come before the 
531
  ** indices.  Hence, the record number for the table must be allocated
531
  ** indices.  Hence, the record number for the table must be allocated
532
  ** now.
532
  ** now.
Lines 1461-1467 Link Here
1461
** Create a new index for an SQL table.  pIndex is the name of the index 
1461
** Create a new index for an SQL table.  pIndex is the name of the index 
1462
** and pTable is the name of the table that is to be indexed.  Both will 
1462
** and pTable is the name of the table that is to be indexed.  Both will 
1463
** be NULL for a primary key or an index that is created to satisfy a
1463
** be NULL for a primary key or an index that is created to satisfy a
1464
** UNITQUE constraint.  If pTable and pIndex are NULL, use pParse->pNewTable
1464
** UNIQUE constraint.  If pTable and pIndex are NULL, use pParse->pNewTable
1465
** as the table to be indexed.  pParse->pNewTable is a table that is
1465
** as the table to be indexed.  pParse->pNewTable is a table that is
1466
** currently being constructed by a CREATE TABLE statement.
1466
** currently being constructed by a CREATE TABLE statement.
1467
**
1467
**
Lines 1531-1537 Link Here
1531
  ** index, then we will continue to process this index.
1531
  ** index, then we will continue to process this index.
1532
  **
1532
  **
1533
  ** If pName==0 it means that we are
1533
  ** If pName==0 it means that we are
1534
  ** dealing with a primary key or UNITQUE constraint.  We have to invent our
1534
  ** dealing with a primary key or UNIQUE constraint.  We have to invent our
1535
  ** own name.
1535
  ** own name.
1536
  */
1536
  */
1537
  if( pName && !db->init.busy ){
1537
  if( pName && !db->init.busy ){
Lines 1673-1679 Link Here
1673
  ** we don't want to recreate it.
1673
  ** we don't want to recreate it.
1674
  **
1674
  **
1675
  ** If pTable==0 it means this index is generated as a primary key
1675
  ** If pTable==0 it means this index is generated as a primary key
1676
  ** or UNITQUE constraint of a CREATE TABLE statement.  Since the table
1676
  ** or UNIQUE constraint of a CREATE TABLE statement.  Since the table
1677
  ** has just been created, it contains no data and the index initialization
1677
  ** has just been created, it contains no data and the index initialization
1678
  ** step can be skipped.
1678
  ** step can be skipped.
1679
  */
1679
  */
Lines 1767-1773 Link Here
1767
    goto exit_drop_index;
1767
    goto exit_drop_index;
1768
  }
1768
  }
1769
  if( pIndex->autoIndex ){
1769
  if( pIndex->autoIndex ){
1770
    sqliteErrorMsg(pParse, "index associated with UNITQUE "
1770
    sqliteErrorMsg(pParse, "index associated with UNIQUE "
1771
      "or PRIMARY KEY constraint cannot be dropped", 0);
1771
      "or PRIMARY KEY constraint cannot be dropped", 0);
1772
    goto exit_drop_index;
1772
    goto exit_drop_index;
1773
  }
1773
  }
(-)koffice/kexi/3rdparty/kexisql/src/insert.c (-5 / +5 lines)
Lines 567-573 Link Here
567
** aIdxUsed!=0 and aIdxUsed[i]!=0.
567
** aIdxUsed!=0 and aIdxUsed[i]!=0.
568
**
568
**
569
** This routine also generates code to check constraints.  NOT NULL,
569
** This routine also generates code to check constraints.  NOT NULL,
570
** CHECK, and UNITQUE constraints are all checked.  If a constraint fails,
570
** CHECK, and UNIQUE constraints are all checked.  If a constraint fails,
571
** then the appropriate action is performed.  There are five possible
571
** then the appropriate action is performed.  There are five possible
572
** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
572
** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
573
**
573
**
Lines 595-601 Link Here
595
**                                value for that column.  If the default value
595
**                                value for that column.  If the default value
596
**                                is NULL, the action is the same as ABORT.
596
**                                is NULL, the action is the same as ABORT.
597
**
597
**
598
**  UNITQUE           REPLACE      The other row that conflicts with the row
598
**  UNIQUE           REPLACE      The other row that conflicts with the row
599
**                                being inserted is removed.
599
**                                being inserted is removed.
600
**
600
**
601
**  CHECK            REPLACE      Illegal.  The results in an exception.
601
**  CHECK            REPLACE      Illegal.  The results in an exception.
Lines 753-759 Link Here
753
    }
753
    }
754
  }
754
  }
755
755
756
  /* Test all UNITQUE constraints by creating entries for each UNITQUE
756
  /* Test all UNIQUE constraints by creating entries for each UNIQUE
757
  ** index and making sure that duplicate entries do not already exist.
757
  ** index and making sure that duplicate entries do not already exist.
758
  ** Add the new records to the indices as we go.
758
  ** Add the new records to the indices as we go.
759
  */
759
  */
Lines 777-783 Link Here
777
777
778
    /* Find out what action to take in case there is an indexing conflict */
778
    /* Find out what action to take in case there is an indexing conflict */
779
    onError = pIdx->onError;
779
    onError = pIdx->onError;
780
    if( onError==OE_None ) continue;  /* pIdx is not a UNITQUE index */
780
    if( onError==OE_None ) continue;  /* pIdx is not a UNIQUE index */
781
    if( overrideError!=OE_Default ){
781
    if( overrideError!=OE_Default ){
782
      onError = overrideError;
782
      onError = overrideError;
783
    }else if( pParse->db->onError!=OE_Default ){
783
    }else if( pParse->db->onError!=OE_Default ){
Lines 843-849 Link Here
843
      default: assert(0);
843
      default: assert(0);
844
    }
844
    }
845
    contAddr = sqliteVdbeCurrentAddr(v);
845
    contAddr = sqliteVdbeCurrentAddr(v);
846
#if NULL_DISTINCT_FOR_UNITQUE
846
#if NULL_DISTINCT_FOR_UNIQUE
847
    sqliteVdbeChangeP2(v, jumpInst1, contAddr);
847
    sqliteVdbeChangeP2(v, jumpInst1, contAddr);
848
#endif
848
#endif
849
    sqliteVdbeChangeP2(v, jumpInst2, contAddr);
849
    sqliteVdbeChangeP2(v, jumpInst2, contAddr);
(-)koffice/kexi/3rdparty/kexisql/src/main.c (-1 / +1 lines)
Lines 90-96 Link Here
90
        db->init.iDb = 0;
90
        db->init.iDb = 0;
91
      }else{
91
      }else{
92
        /* If the SQL column is blank it means this is an index that
92
        /* If the SQL column is blank it means this is an index that
93
        ** was created to be the PRIMARY KEY or to fulfill a UNITQUE
93
        ** was created to be the PRIMARY KEY or to fulfill a UNIQUE
94
        ** constraint for a CREATE TABLE.  The index should have already
94
        ** constraint for a CREATE TABLE.  The index should have already
95
        ** been created when we processed the CREATE TABLE.  All we have
95
        ** been created when we processed the CREATE TABLE.  All we have
96
        ** to do here is record the root page number for that index.
96
        ** to do here is record the root page number for that index.
(-)koffice/kexi/3rdparty/kexisql/src/parse.c (-8 / +8 lines)
Lines 711-717 Link Here
711
    0,  /*      FLOAT => nothing */
711
    0,  /*      FLOAT => nothing */
712
    0,  /*       NULL => nothing */
712
    0,  /*       NULL => nothing */
713
    0,  /*    PRIMARY => nothing */
713
    0,  /*    PRIMARY => nothing */
714
    0,  /*     UNITQUE => nothing */
714
    0,  /*     UNIQUE => nothing */
715
    0,  /*      CHECK => nothing */
715
    0,  /*      CHECK => nothing */
716
    0,  /* REFERENCES => nothing */
716
    0,  /* REFERENCES => nothing */
717
    0,  /*    COLLATE => nothing */
717
    0,  /*    COLLATE => nothing */
Lines 840-846 Link Here
840
  "STAR",          "SLASH",         "REM",           "CONCAT",      
840
  "STAR",          "SLASH",         "REM",           "CONCAT",      
841
  "UMINUS",        "UPLUS",         "BITNOT",        "STRING",      
841
  "UMINUS",        "UPLUS",         "BITNOT",        "STRING",      
842
  "JOIN_KW",       "INTEGER",       "CONSTRAINT",    "DEFAULT",     
842
  "JOIN_KW",       "INTEGER",       "CONSTRAINT",    "DEFAULT",     
843
  "FLOAT",         "NULL",          "PRIMARY",       "UNITQUE",      
843
  "FLOAT",         "NULL",          "PRIMARY",       "UNIQUE",      
844
  "CHECK",         "REFERENCES",    "COLLATE",       "ON",          
844
  "CHECK",         "REFERENCES",    "COLLATE",       "ON",          
845
  "DELETE",        "UPDATE",        "INSERT",        "SET",         
845
  "DELETE",        "UPDATE",        "INSERT",        "SET",         
846
  "DEFERRABLE",    "FOREIGN",       "DROP",          "UNION",       
846
  "DEFERRABLE",    "FOREIGN",       "DROP",          "UNION",       
Lines 935-941 Link Here
935
 /*  53 */ "ccons ::= NULL onconf",
935
 /*  53 */ "ccons ::= NULL onconf",
936
 /*  54 */ "ccons ::= NOT NULL onconf",
936
 /*  54 */ "ccons ::= NOT NULL onconf",
937
 /*  55 */ "ccons ::= PRIMARY KEY sortorder onconf",
937
 /*  55 */ "ccons ::= PRIMARY KEY sortorder onconf",
938
 /*  56 */ "ccons ::= UNITQUE onconf",
938
 /*  56 */ "ccons ::= UNIQUE onconf",
939
 /*  57 */ "ccons ::= CHECK LP expr RP onconf",
939
 /*  57 */ "ccons ::= CHECK LP expr RP onconf",
940
 /*  58 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
940
 /*  58 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
941
 /*  59 */ "ccons ::= defer_subclause",
941
 /*  59 */ "ccons ::= defer_subclause",
Lines 962-968 Link Here
962
 /*  80 */ "conslist ::= tcons",
962
 /*  80 */ "conslist ::= tcons",
963
 /*  81 */ "tcons ::= CONSTRAINT nm",
963
 /*  81 */ "tcons ::= CONSTRAINT nm",
964
 /*  82 */ "tcons ::= PRIMARY KEY LP idxlist RP onconf",
964
 /*  82 */ "tcons ::= PRIMARY KEY LP idxlist RP onconf",
965
 /*  83 */ "tcons ::= UNITQUE LP idxlist RP onconf",
965
 /*  83 */ "tcons ::= UNIQUE LP idxlist RP onconf",
966
 /*  84 */ "tcons ::= CHECK expr onconf",
966
 /*  84 */ "tcons ::= CHECK expr onconf",
967
 /*  85 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
967
 /*  85 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
968
 /*  86 */ "defer_subclause_opt ::=",
968
 /*  86 */ "defer_subclause_opt ::=",
Lines 1115-1121 Link Here
1115
 /* 233 */ "expritem ::= expr",
1115
 /* 233 */ "expritem ::= expr",
1116
 /* 234 */ "expritem ::=",
1116
 /* 234 */ "expritem ::=",
1117
 /* 235 */ "cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf",
1117
 /* 235 */ "cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf",
1118
 /* 236 */ "uniqueflag ::= UNITQUE",
1118
 /* 236 */ "uniqueflag ::= UNIQUE",
1119
 /* 237 */ "uniqueflag ::=",
1119
 /* 237 */ "uniqueflag ::=",
1120
 /* 238 */ "idxlist_opt ::=",
1120
 /* 238 */ "idxlist_opt ::=",
1121
 /* 239 */ "idxlist_opt ::= LP idxlist RP",
1121
 /* 239 */ "idxlist_opt ::= LP idxlist RP",
Lines 2183-2189 Link Here
2183
#line 191 "parse.y"
2183
#line 191 "parse.y"
2184
{sqliteCreateIndex(pParse,0,0,0,yymsp[0].minor.yy372,0,0);}
2184
{sqliteCreateIndex(pParse,0,0,0,yymsp[0].minor.yy372,0,0);}
2185
#line 2185 "parse.c"
2185
#line 2185 "parse.c"
2186
        /* No destructor defined for UNITQUE */
2186
        /* No destructor defined for UNIQUE */
2187
        break;
2187
        break;
2188
      case 57:
2188
      case 57:
2189
        /* No destructor defined for CHECK */
2189
        /* No destructor defined for CHECK */
Lines 2342-2348 Link Here
2342
#line 238 "parse.y"
2342
#line 238 "parse.y"
2343
{sqliteCreateIndex(pParse,0,0,yymsp[-2].minor.yy320,yymsp[0].minor.yy372,0,0);}
2343
{sqliteCreateIndex(pParse,0,0,yymsp[-2].minor.yy320,yymsp[0].minor.yy372,0,0);}
2344
#line 2344 "parse.c"
2344
#line 2344 "parse.c"
2345
        /* No destructor defined for UNITQUE */
2345
        /* No destructor defined for UNIQUE */
2346
        /* No destructor defined for LP */
2346
        /* No destructor defined for LP */
2347
        /* No destructor defined for RP */
2347
        /* No destructor defined for RP */
2348
        break;
2348
        break;
Lines 3428-3434 Link Here
3428
#line 740 "parse.y"
3428
#line 740 "parse.y"
3429
{ yygotominor.yy372 = OE_Abort; }
3429
{ yygotominor.yy372 = OE_Abort; }
3430
#line 3430 "parse.c"
3430
#line 3430 "parse.c"
3431
        /* No destructor defined for UNITQUE */
3431
        /* No destructor defined for UNIQUE */
3432
        break;
3432
        break;
3433
      case 237:
3433
      case 237:
3434
#line 741 "parse.y"
3434
#line 741 "parse.y"
(-)koffice/kexi/3rdparty/kexisql/src/parse.h (-1 / +1 lines)
Lines 92-98 Link Here
92
#define TK_FLOAT                          92
92
#define TK_FLOAT                          92
93
#define TK_NULL                           93
93
#define TK_NULL                           93
94
#define TK_PRIMARY                        94
94
#define TK_PRIMARY                        94
95
#define TK_UNITQUE                         95
95
#define TK_UNIQUE                         95
96
#define TK_CHECK                          96
96
#define TK_CHECK                          96
97
#define TK_REFERENCES                     97
97
#define TK_REFERENCES                     97
98
#define TK_COLLATE                        98
98
#define TK_COLLATE                        98
(-)koffice/kexi/3rdparty/kexisql/src/sqliteInt.h (-6 / +6 lines)
Lines 45-60 Link Here
45
/*
45
/*
46
** If the following macro is set to 1, then NULL values are considered
46
** If the following macro is set to 1, then NULL values are considered
47
** distinct when determining whether or not two entries are the same
47
** distinct when determining whether or not two entries are the same
48
** in a UNITQUE index.  This is the way PostgreSQL, Oracle, DB2, MySQL,
48
** in a UNIQUE index.  This is the way PostgreSQL, Oracle, DB2, MySQL,
49
** OCELOT, and Firebird all work.  The SQL92 spec explicitly says this
49
** OCELOT, and Firebird all work.  The SQL92 spec explicitly says this
50
** is the way things are suppose to work.
50
** is the way things are suppose to work.
51
**
51
**
52
** If the following macro is set to 0, the NULLs are indistinct for
52
** If the following macro is set to 0, the NULLs are indistinct for
53
** a UNITQUE index.  In this mode, you can only have a single NULL entry
53
** a UNIQUE index.  In this mode, you can only have a single NULL entry
54
** for a column declared UNITQUE.  This is the way Informix and SQL Server
54
** for a column declared UNIQUE.  This is the way Informix and SQL Server
55
** work.
55
** work.
56
*/
56
*/
57
#define NULL_DISTINCT_FOR_UNITQUE 1
57
#define NULL_DISTINCT_FOR_UNIQUE 1
58
58
59
/*
59
/*
60
** The maximum number of attached databases.  This must be at least 2
60
** The maximum number of attached databases.  This must be at least 2
Lines 563-569 Link Here
563
** occurs.  IGNORE means that the particular row that caused the constraint
563
** occurs.  IGNORE means that the particular row that caused the constraint
564
** error is not inserted or updated.  Processing continues and no error
564
** error is not inserted or updated.  Processing continues and no error
565
** is returned.  REPLACE means that preexisting database rows that caused
565
** is returned.  REPLACE means that preexisting database rows that caused
566
** a UNITQUE constraint violation are removed so that the new insert or
566
** a UNIQUE constraint violation are removed so that the new insert or
567
** update can proceed.  Processing continues and no error is reported.
567
** update can proceed.  Processing continues and no error is reported.
568
**
568
**
569
** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
569
** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
Lines 623-629 Link Here
623
  Table *pTable;   /* The SQL table being indexed */
623
  Table *pTable;   /* The SQL table being indexed */
624
  int tnum;        /* Page containing root of this index in database file */
624
  int tnum;        /* Page containing root of this index in database file */
625
  u8 onError;      /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
625
  u8 onError;      /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
626
  u8 autoIndex;    /* True if is automatically created (ex: by UNITQUE) */
626
  u8 autoIndex;    /* True if is automatically created (ex: by UNIQUE) */
627
  u8 iDb;          /* Index in sqlite.aDb[] of where this index is stored */
627
  u8 iDb;          /* Index in sqlite.aDb[] of where this index is stored */
628
  Index *pNext;    /* The next index associated with the same table */
628
  Index *pNext;    /* The next index associated with the same table */
629
};
629
};
(-)koffice/kexi/3rdparty/kexisql/src/tokenize.c (-1 / +1 lines)
Lines 130-136 Link Here
130
  { "TRANSACTION",       TK_TRANSACTION,  },
130
  { "TRANSACTION",       TK_TRANSACTION,  },
131
  { "TRIGGER",           TK_TRIGGER,      },
131
  { "TRIGGER",           TK_TRIGGER,      },
132
  { "UNION",             TK_UNION,        },
132
  { "UNION",             TK_UNION,        },
133
  { "UNITQUE",            TK_UNITQUE,       },
133
  { "UNIQUE",            TK_UNIQUE,       },
134
  { "UPDATE",            TK_UPDATE,       },
134
  { "UPDATE",            TK_UPDATE,       },
135
  { "USING",             TK_USING,        },
135
  { "USING",             TK_USING,        },
136
  { "VACUUM",            TK_VACUUM,       },
136
  { "VACUUM",            TK_VACUUM,       },
(-)koffice/kexi/3rdparty/kexisql/src/vdbe.c (-1 / +1 lines)
Lines 2741-2747 Link Here
2741
    /* The last four bytes of the key are different from R.  Convert the
2741
    /* The last four bytes of the key are different from R.  Convert the
2742
    ** last four bytes of the key into an integer and push it onto the
2742
    ** last four bytes of the key into an integer and push it onto the
2743
    ** stack.  (These bytes are the record number of an entry that
2743
    ** stack.  (These bytes are the record number of an entry that
2744
    ** violates a UNITQUE constraint.)
2744
    ** violates a UNIQUE constraint.)
2745
    */
2745
    */
2746
    pTos++;
2746
    pTos++;
2747
    pTos->i = v;
2747
    pTos->i = v;
(-)koffice/kexi/3rdparty/kexisql3/src/alter.c (-2 / +2 lines)
Lines 407-413 Link Here
407
    pDflt = 0;
407
    pDflt = 0;
408
  }
408
  }
409
409
410
  /* Check that the new column is not specified as PRIMARY KEY or UNITQUE.
410
  /* Check that the new column is not specified as PRIMARY KEY or UNIQUE.
411
  ** If there is a NOT NULL constraint, then the default value for the
411
  ** If there is a NOT NULL constraint, then the default value for the
412
  ** column must not be NULL.
412
  ** column must not be NULL.
413
  */
413
  */
Lines 416-422 Link Here
416
    return;
416
    return;
417
  }
417
  }
418
  if( pNew->pIndex ){
418
  if( pNew->pIndex ){
419
    sqlite3ErrorMsg(pParse, "Cannot add a UNITQUE column");
419
    sqlite3ErrorMsg(pParse, "Cannot add a UNIQUE column");
420
    return;
420
    return;
421
  }
421
  }
422
  if( pCol->notNull && !pDflt ){
422
  if( pCol->notNull && !pDflt ){
(-)koffice/kexi/3rdparty/kexisql3/src/btree.c (-3 / +3 lines)
Lines 3930-3942 Link Here
3930
  }
3930
  }
3931
  szCell = (int*)&apCell[nMaxCells];
3931
  szCell = (int*)&apCell[nMaxCells];
3932
  aCopy[0] = (u8*)&szCell[nMaxCells];
3932
  aCopy[0] = (u8*)&szCell[nMaxCells];
3933
  assert( ((aCopy[0] - (u8*)apCell) & 7)==0 ); /* 8-byte tqalignment required */
3933
  assert( ((aCopy[0] - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */
3934
  for(i=1; i<NB; i++){
3934
  for(i=1; i<NB; i++){
3935
    aCopy[i] = &aCopy[i-1][pBt->pageSize+ROUND8(sizeof(MemPage))];
3935
    aCopy[i] = &aCopy[i-1][pBt->pageSize+ROUND8(sizeof(MemPage))];
3936
    assert( ((aCopy[i] - (u8*)apCell) & 7)==0 ); /* 8-byte tqalignment required */
3936
    assert( ((aCopy[i] - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */
3937
  }
3937
  }
3938
  aSpace = &aCopy[NB-1][pBt->pageSize+ROUND8(sizeof(MemPage))];
3938
  aSpace = &aCopy[NB-1][pBt->pageSize+ROUND8(sizeof(MemPage))];
3939
  assert( ((aSpace - (u8*)apCell) & 7)==0 ); /* 8-byte tqalignment required */
3939
  assert( ((aSpace - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */
3940
#ifndef SQLITE_OMIT_AUTOVACUUM
3940
#ifndef SQLITE_OMIT_AUTOVACUUM
3941
  if( pBt->autoVacuum ){
3941
  if( pBt->autoVacuum ){
3942
    aFrom = &aSpace[5*pBt->pageSize];
3942
    aFrom = &aSpace[5*pBt->pageSize];
(-)koffice/kexi/3rdparty/kexisql3/src/build.c (-10 / +10 lines)
Lines 746-752 Link Here
746
  /* Begin generating the code that will insert the table record into
746
  /* Begin generating the code that will insert the table record into
747
  ** the SQLITE_MASTER table.  Note in particular that we must go ahead
747
  ** the SQLITE_MASTER table.  Note in particular that we must go ahead
748
  ** and allocate the record number for the table entry now.  Before any
748
  ** and allocate the record number for the table entry now.  Before any
749
  ** PRIMARY KEY or UNITQUE keywords are parsed.  Those keywords will cause
749
  ** PRIMARY KEY or UNIQUE keywords are parsed.  Those keywords will cause
750
  ** indices to be created and the table record must come before the 
750
  ** indices to be created and the table record must come before the 
751
  ** indices.  Hence, the record number for the table must be allocated
751
  ** indices.  Hence, the record number for the table must be allocated
752
  ** now.
752
  ** now.
Lines 2011-2017 Link Here
2011
** Create a new index for an SQL table.  pName1.pName2 is the name of the index 
2011
** Create a new index for an SQL table.  pName1.pName2 is the name of the index 
2012
** and pTblList is the name of the table that is to be indexed.  Both will 
2012
** and pTblList is the name of the table that is to be indexed.  Both will 
2013
** be NULL for a primary key or an index that is created to satisfy a
2013
** be NULL for a primary key or an index that is created to satisfy a
2014
** UNITQUE constraint.  If pTable and pIndex are NULL, use pParse->pNewTable
2014
** UNIQUE constraint.  If pTable and pIndex are NULL, use pParse->pNewTable
2015
** as the table to be indexed.  pParse->pNewTable is a table that is
2015
** as the table to be indexed.  pParse->pNewTable is a table that is
2016
** currently being constructed by a CREATE TABLE statement.
2016
** currently being constructed by a CREATE TABLE statement.
2017
**
2017
**
Lines 2104-2110 Link Here
2104
  ** index, then we will continue to process this index.
2104
  ** index, then we will continue to process this index.
2105
  **
2105
  **
2106
  ** If pName==0 it means that we are
2106
  ** If pName==0 it means that we are
2107
  ** dealing with a primary key or UNITQUE constraint.  We have to invent our
2107
  ** dealing with a primary key or UNIQUE constraint.  We have to invent our
2108
  ** own name.
2108
  ** own name.
2109
  */
2109
  */
2110
  if( pName ){
2110
  if( pName ){
Lines 2211-2222 Link Here
2211
2211
2212
  if( pTab==pParse->pNewTable ){
2212
  if( pTab==pParse->pNewTable ){
2213
    /* This routine has been called to create an automatic index as a
2213
    /* This routine has been called to create an automatic index as a
2214
    ** result of a PRIMARY KEY or UNITQUE clause on a column definition, or
2214
    ** result of a PRIMARY KEY or UNIQUE clause on a column definition, or
2215
    ** a PRIMARY KEY or UNITQUE clause following the column definitions.
2215
    ** a PRIMARY KEY or UNIQUE clause following the column definitions.
2216
    ** i.e. one of:
2216
    ** i.e. one of:
2217
    **
2217
    **
2218
    ** CREATE TABLE t(x PRIMARY KEY, y);
2218
    ** CREATE TABLE t(x PRIMARY KEY, y);
2219
    ** CREATE TABLE t(x, y, UNITQUE(x, y));
2219
    ** CREATE TABLE t(x, y, UNIQUE(x, y));
2220
    **
2220
    **
2221
    ** Either way, check to see if the table already has such an index. If
2221
    ** Either way, check to see if the table already has such an index. If
2222
    ** so, don't bother creating this one. This only applies to
2222
    ** so, don't bother creating this one. This only applies to
Lines 2285-2291 Link Here
2285
  ** we don't want to recreate it.
2285
  ** we don't want to recreate it.
2286
  **
2286
  **
2287
  ** If pTblName==0 it means this index is generated as a primary key
2287
  ** If pTblName==0 it means this index is generated as a primary key
2288
  ** or UNITQUE constraint of a CREATE TABLE statement.  Since the table
2288
  ** or UNIQUE constraint of a CREATE TABLE statement.  Since the table
2289
  ** has just been created, it contains no data and the index initialization
2289
  ** has just been created, it contains no data and the index initialization
2290
  ** step can be skipped.
2290
  ** step can be skipped.
2291
  */
2291
  */
Lines 2309-2319 Link Here
2309
    if( pStart && pEnd ){
2309
    if( pStart && pEnd ){
2310
      /* A named index with an explicit CREATE INDEX statement */
2310
      /* A named index with an explicit CREATE INDEX statement */
2311
      zStmt = sqlite3MPrintf("CREATE%s INDEX %.*s",
2311
      zStmt = sqlite3MPrintf("CREATE%s INDEX %.*s",
2312
        onError==OE_None ? "" : " UNITQUE",
2312
        onError==OE_None ? "" : " UNIQUE",
2313
        pEnd->z - pName->z + 1,
2313
        pEnd->z - pName->z + 1,
2314
        pName->z);
2314
        pName->z);
2315
    }else{
2315
    }else{
2316
      /* An automatic index created by a PRIMARY KEY or UNITQUE constraint */
2316
      /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */
2317
      /* zStmt = sqlite3MPrintf(""); */
2317
      /* zStmt = sqlite3MPrintf(""); */
2318
      zStmt = 0;
2318
      zStmt = 0;
2319
    }
2319
    }
Lines 2428-2434 Link Here
2428
    goto exit_drop_index;
2428
    goto exit_drop_index;
2429
  }
2429
  }
2430
  if( pIndex->autoIndex ){
2430
  if( pIndex->autoIndex ){
2431
    sqlite3ErrorMsg(pParse, "index associated with UNITQUE "
2431
    sqlite3ErrorMsg(pParse, "index associated with UNIQUE "
2432
      "or PRIMARY KEY constraint cannot be dropped", 0);
2432
      "or PRIMARY KEY constraint cannot be dropped", 0);
2433
    goto exit_drop_index;
2433
    goto exit_drop_index;
2434
  }
2434
  }
(-)koffice/kexi/3rdparty/kexisql3/src/insert.c (-5 / +5 lines)
Lines 746-752 Link Here
746
** aIdxUsed!=0 and aIdxUsed[i]!=0.
746
** aIdxUsed!=0 and aIdxUsed[i]!=0.
747
**
747
**
748
** This routine also generates code to check constraints.  NOT NULL,
748
** This routine also generates code to check constraints.  NOT NULL,
749
** CHECK, and UNITQUE constraints are all checked.  If a constraint fails,
749
** CHECK, and UNIQUE constraints are all checked.  If a constraint fails,
750
** then the appropriate action is performed.  There are five possible
750
** then the appropriate action is performed.  There are five possible
751
** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
751
** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
752
**
752
**
Lines 774-780 Link Here
774
**                                value for that column.  If the default value
774
**                                value for that column.  If the default value
775
**                                is NULL, the action is the same as ABORT.
775
**                                is NULL, the action is the same as ABORT.
776
**
776
**
777
**  UNITQUE           REPLACE      The other row that conflicts with the row
777
**  UNIQUE           REPLACE      The other row that conflicts with the row
778
**                                being inserted is removed.
778
**                                being inserted is removed.
779
**
779
**
780
**  CHECK            REPLACE      Illegal.  The results in an exception.
780
**  CHECK            REPLACE      Illegal.  The results in an exception.
Lines 927-933 Link Here
927
    }
927
    }
928
  }
928
  }
929
929
930
  /* Test all UNITQUE constraints by creating entries for each UNITQUE
930
  /* Test all UNIQUE constraints by creating entries for each UNIQUE
931
  ** index and making sure that duplicate entries do not already exist.
931
  ** index and making sure that duplicate entries do not already exist.
932
  ** Add the new records to the indices as we go.
932
  ** Add the new records to the indices as we go.
933
  */
933
  */
Lines 951-957 Link Here
951
951
952
    /* Find out what action to take in case there is an indexing conflict */
952
    /* Find out what action to take in case there is an indexing conflict */
953
    onError = pIdx->onError;
953
    onError = pIdx->onError;
954
    if( onError==OE_None ) continue;  /* pIdx is not a UNITQUE index */
954
    if( onError==OE_None ) continue;  /* pIdx is not a UNIQUE index */
955
    if( overrideError!=OE_Default ){
955
    if( overrideError!=OE_Default ){
956
      onError = overrideError;
956
      onError = overrideError;
957
    }else if( onError==OE_Default ){
957
    }else if( onError==OE_Default ){
Lines 1015-1021 Link Here
1015
        break;
1015
        break;
1016
      }
1016
      }
1017
    }
1017
    }
1018
#if NULL_DISTINCT_FOR_UNITQUE
1018
#if NULL_DISTINCT_FOR_UNIQUE
1019
    sqlite3VdbeJumpHere(v, jumpInst1);
1019
    sqlite3VdbeJumpHere(v, jumpInst1);
1020
#endif
1020
#endif
1021
    sqlite3VdbeJumpHere(v, jumpInst2);
1021
    sqlite3VdbeJumpHere(v, jumpInst2);
(-)koffice/kexi/3rdparty/kexisql3/src/keywordhash.h (-2 / +2 lines)
Lines 9-15 Link Here
9
    "CURRENT_DATECURRENT_TIMESTAMPLANDESCDETACHDISTINCTDROPRAGMATCH"
9
    "CURRENT_DATECURRENT_TIMESTAMPLANDESCDETACHDISTINCTDROPRAGMATCH"
10
    "FAILIMITFROMFULLGROUPDATEIMMEDIATEINSERTINSTEADINTOFFSETISNULL"
10
    "FAILIMITFROMFULLGROUPDATEIMMEDIATEINSERTINSTEADINTOFFSETISNULL"
11
    "JOINORDEREPLACEOUTERESTRICTPRIMARYTQUERYRIGHTROLLBACKROWHENUNION"
11
    "JOINORDEREPLACEOUTERESTRICTPRIMARYTQUERYRIGHTROLLBACKROWHENUNION"
12
    "UNITQUEUSINGVACUUMVALUESVIEWHERE";
12
    "UNIQUEUSINGVACUUMVALUESVIEWHERE";
13
  static const unsigned char aHash[127] = {
13
  static const unsigned char aHash[127] = {
14
      91,  80, 106,  90,   0,   4,   0,   0, 113,   0,  83,   0,   0,
14
      91,  80, 106,  90,   0,   4,   0,   0, 113,   0,  83,   0,   0,
15
      94,  44,  76,  92,   0, 105, 108,  96,   0,   0,  10,   0,   0,
15
      94,  44,  76,  92,   0, 105, 108,  96,   0,   0,  10,   0,   0,
Lines 77-83 Link Here
77
    TK_INSERT,     TK_INSTEAD,    TK_INTO,       TK_OF,         TK_OFFSET,     
77
    TK_INSERT,     TK_INSTEAD,    TK_INTO,       TK_OF,         TK_OFFSET,     
78
    TK_SET,        TK_ISNULL,     TK_JOIN,       TK_ORDER,      TK_REPLACE,    
78
    TK_SET,        TK_ISNULL,     TK_JOIN,       TK_ORDER,      TK_REPLACE,    
79
    TK_JOIN_KW,    TK_RESTRICT,   TK_PRIMARY,    TK_TQUERY,      TK_JOIN_KW,    
79
    TK_JOIN_KW,    TK_RESTRICT,   TK_PRIMARY,    TK_TQUERY,      TK_JOIN_KW,    
80
    TK_ROLLBACK,   TK_ROW,        TK_WHEN,       TK_UNION,      TK_UNITQUE,     
80
    TK_ROLLBACK,   TK_ROW,        TK_WHEN,       TK_UNION,      TK_UNIQUE,     
81
    TK_USING,      TK_VACUUM,     TK_VALUES,     TK_VIEW,       TK_WHERE,      
81
    TK_USING,      TK_VACUUM,     TK_VALUES,     TK_VIEW,       TK_WHERE,      
82
  };
82
  };
83
  int h, i;
83
  int h, i;
(-)koffice/kexi/3rdparty/kexisql3/src/parse.c (-5 / +5 lines)
Lines 770-776 Link Here
770
    0,  /*    DEFAULT => nothing */
770
    0,  /*    DEFAULT => nothing */
771
    0,  /*       NULL => nothing */
771
    0,  /*       NULL => nothing */
772
    0,  /*    PRIMARY => nothing */
772
    0,  /*    PRIMARY => nothing */
773
    0,  /*     UNITQUE => nothing */
773
    0,  /*     UNIQUE => nothing */
774
    0,  /*      CHECK => nothing */
774
    0,  /*      CHECK => nothing */
775
    0,  /* REFERENCES => nothing */
775
    0,  /* REFERENCES => nothing */
776
    0,  /*    COLLATE => nothing */
776
    0,  /*    COLLATE => nothing */
Lines 910-916 Link Here
910
  "STAR",          "SLASH",         "REM",           "CONCAT",      
910
  "STAR",          "SLASH",         "REM",           "CONCAT",      
911
  "UMINUS",        "UPLUS",         "BITNOT",        "STRING",      
911
  "UMINUS",        "UPLUS",         "BITNOT",        "STRING",      
912
  "JOIN_KW",       "CONSTRAINT",    "DEFAULT",       "NULL",        
912
  "JOIN_KW",       "CONSTRAINT",    "DEFAULT",       "NULL",        
913
  "PRIMARY",       "UNITQUE",        "CHECK",         "REFERENCES",  
913
  "PRIMARY",       "UNIQUE",        "CHECK",         "REFERENCES",  
914
  "COLLATE",       "AUTOINCR",      "ON",            "DELETE",      
914
  "COLLATE",       "AUTOINCR",      "ON",            "DELETE",      
915
  "UPDATE",        "INSERT",        "SET",           "DEFERRABLE",  
915
  "UPDATE",        "INSERT",        "SET",           "DEFERRABLE",  
916
  "FOREIGN",       "DROP",          "UNION",         "ALL",         
916
  "FOREIGN",       "DROP",          "UNION",         "ALL",         
Lines 1011-1017 Link Here
1011
 /*  54 */ "ccons ::= NULL onconf",
1011
 /*  54 */ "ccons ::= NULL onconf",
1012
 /*  55 */ "ccons ::= NOT NULL onconf",
1012
 /*  55 */ "ccons ::= NOT NULL onconf",
1013
 /*  56 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
1013
 /*  56 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
1014
 /*  57 */ "ccons ::= UNITQUE onconf",
1014
 /*  57 */ "ccons ::= UNIQUE onconf",
1015
 /*  58 */ "ccons ::= CHECK LP expr RP onconf",
1015
 /*  58 */ "ccons ::= CHECK LP expr RP onconf",
1016
 /*  59 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
1016
 /*  59 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
1017
 /*  60 */ "ccons ::= defer_subclause",
1017
 /*  60 */ "ccons ::= defer_subclause",
Lines 1040-1046 Link Here
1040
 /*  83 */ "conslist ::= tcons",
1040
 /*  83 */ "conslist ::= tcons",
1041
 /*  84 */ "tcons ::= CONSTRAINT nm",
1041
 /*  84 */ "tcons ::= CONSTRAINT nm",
1042
 /*  85 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
1042
 /*  85 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
1043
 /*  86 */ "tcons ::= UNITQUE LP idxlist RP onconf",
1043
 /*  86 */ "tcons ::= UNIQUE LP idxlist RP onconf",
1044
 /*  87 */ "tcons ::= CHECK expr onconf",
1044
 /*  87 */ "tcons ::= CHECK expr onconf",
1045
 /*  88 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
1045
 /*  88 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
1046
 /*  89 */ "defer_subclause_opt ::=",
1046
 /*  89 */ "defer_subclause_opt ::=",
Lines 1199-1205 Link Here
1199
 /* 242 */ "expritem ::= expr",
1199
 /* 242 */ "expritem ::= expr",
1200
 /* 243 */ "expritem ::=",
1200
 /* 243 */ "expritem ::=",
1201
 /* 244 */ "cmd ::= CREATE uniqueflag INDEX nm dbnm ON nm LP idxlist RP onconf",
1201
 /* 244 */ "cmd ::= CREATE uniqueflag INDEX nm dbnm ON nm LP idxlist RP onconf",
1202
 /* 245 */ "uniqueflag ::= UNITQUE",
1202
 /* 245 */ "uniqueflag ::= UNIQUE",
1203
 /* 246 */ "uniqueflag ::=",
1203
 /* 246 */ "uniqueflag ::=",
1204
 /* 247 */ "idxlist_opt ::=",
1204
 /* 247 */ "idxlist_opt ::=",
1205
 /* 248 */ "idxlist_opt ::= LP idxlist RP",
1205
 /* 248 */ "idxlist_opt ::= LP idxlist RP",
(-)koffice/kexi/3rdparty/kexisql3/src/parse.h (-1 / +1 lines)
Lines 98-104 Link Here
98
#define TK_DEFAULT                        98
98
#define TK_DEFAULT                        98
99
#define TK_NULL                           99
99
#define TK_NULL                           99
100
#define TK_PRIMARY                        100
100
#define TK_PRIMARY                        100
101
#define TK_UNITQUE                         101
101
#define TK_UNIQUE                         101
102
#define TK_CHECK                          102
102
#define TK_CHECK                          102
103
#define TK_REFERENCES                     103
103
#define TK_REFERENCES                     103
104
#define TK_COLLATE                        104
104
#define TK_COLLATE                        104
(-)koffice/kexi/3rdparty/kexisql3/src/prepare.c (-1 / +1 lines)
Lines 77-83 Link Here
77
    }
77
    }
78
  }else{
78
  }else{
79
    /* If the SQL column is blank it means this is an index that
79
    /* If the SQL column is blank it means this is an index that
80
    ** was created to be the PRIMARY KEY or to fulfill a UNITQUE
80
    ** was created to be the PRIMARY KEY or to fulfill a UNIQUE
81
    ** constraint for a CREATE TABLE.  The index should have already
81
    ** constraint for a CREATE TABLE.  The index should have already
82
    ** been created when we processed the CREATE TABLE.  All we have
82
    ** been created when we processed the CREATE TABLE.  All we have
83
    ** to do here is record the root page number for that index.
83
    ** to do here is record the root page number for that index.
(-)koffice/kexi/3rdparty/kexisql3/src/sqliteInt.h (-6 / +6 lines)
Lines 104-119 Link Here
104
/*
104
/*
105
** If the following macro is set to 1, then NULL values are considered
105
** If the following macro is set to 1, then NULL values are considered
106
** distinct when determining whether or not two entries are the same
106
** distinct when determining whether or not two entries are the same
107
** in a UNITQUE index.  This is the way PostgreSQL, Oracle, DB2, MySQL,
107
** in a UNIQUE index.  This is the way PostgreSQL, Oracle, DB2, MySQL,
108
** OCELOT, and Firebird all work.  The SQL92 spec explicitly says this
108
** OCELOT, and Firebird all work.  The SQL92 spec explicitly says this
109
** is the way things are suppose to work.
109
** is the way things are suppose to work.
110
**
110
**
111
** If the following macro is set to 0, the NULLs are indistinct for
111
** If the following macro is set to 0, the NULLs are indistinct for
112
** a UNITQUE index.  In this mode, you can only have a single NULL entry
112
** a UNIQUE index.  In this mode, you can only have a single NULL entry
113
** for a column declared UNITQUE.  This is the way Informix and SQL Server
113
** for a column declared UNIQUE.  This is the way Informix and SQL Server
114
** work.
114
** work.
115
*/
115
*/
116
#define NULL_DISTINCT_FOR_UNITQUE 1
116
#define NULL_DISTINCT_FOR_UNIQUE 1
117
117
118
/*
118
/*
119
** The maximum number of attached databases.  This must be at least 2
119
** The maximum number of attached databases.  This must be at least 2
Lines 700-706 Link Here
700
** occurs.  IGNORE means that the particular row that caused the constraint
700
** occurs.  IGNORE means that the particular row that caused the constraint
701
** error is not inserted or updated.  Processing continues and no error
701
** error is not inserted or updated.  Processing continues and no error
702
** is returned.  REPLACE means that preexisting database rows that caused
702
** is returned.  REPLACE means that preexisting database rows that caused
703
** a UNITQUE constraint violation are removed so that the new insert or
703
** a UNIQUE constraint violation are removed so that the new insert or
704
** update can proceed.  Processing continues and no error is reported.
704
** update can proceed.  Processing continues and no error is reported.
705
**
705
**
706
** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
706
** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
Lines 779-785 Link Here
779
  Table *pTable;   /* The SQL table being indexed */
779
  Table *pTable;   /* The SQL table being indexed */
780
  int tnum;        /* Page containing root of this index in database file */
780
  int tnum;        /* Page containing root of this index in database file */
781
  u8 onError;      /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
781
  u8 onError;      /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
782
  u8 autoIndex;    /* True if is automatically created (ex: by UNITQUE) */
782
  u8 autoIndex;    /* True if is automatically created (ex: by UNIQUE) */
783
  u8 iDb;          /* Index in sqlite.aDb[] of where this index is stored */
783
  u8 iDb;          /* Index in sqlite.aDb[] of where this index is stored */
784
  char *zColAff;   /* String defining the affinity of each column */
784
  char *zColAff;   /* String defining the affinity of each column */
785
  Index *pNext;    /* The next index associated with the same table */
785
  Index *pNext;    /* The next index associated with the same table */
(-)koffice/kexi/3rdparty/kexisql3/src/vacuum.c (-2 / +2 lines)
Lines 212-219 Link Here
212
      "  FROM sqlite_master WHERE sql LIKE 'CREATE INDEX %' ", 0);
212
      "  FROM sqlite_master WHERE sql LIKE 'CREATE INDEX %' ", 0);
213
  if( rc!=SQLITE_OK ) goto end_of_vacuum;
213
  if( rc!=SQLITE_OK ) goto end_of_vacuum;
214
  rc = execExecSql(db, 
214
  rc = execExecSql(db, 
215
      "SELECT 'CREATE UNITQUE INDEX vacuum_db.' || substr(sql,21,100000000) "
215
      "SELECT 'CREATE UNIQUE INDEX vacuum_db.' || substr(sql,21,100000000) "
216
      "  FROM sqlite_master WHERE sql LIKE 'CREATE UNITQUE INDEX %'", 0);
216
      "  FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %'", 0);
217
  if( rc!=SQLITE_OK ) goto end_of_vacuum;
217
  if( rc!=SQLITE_OK ) goto end_of_vacuum;
218
  rc = execExecSql(db, 
218
  rc = execExecSql(db, 
219
      "SELECT 'CREATE VIEW vacuum_db.' || substr(sql,13,100000000) "
219
      "SELECT 'CREATE VIEW vacuum_db.' || substr(sql,13,100000000) "
(-)koffice/kexi/3rdparty/kexisql3/src/vdbe.c (-1 / +1 lines)
Lines 2956-2962 Link Here
2956
    }
2956
    }
2957
2957
2958
    /* The final varint of the key is different from R.  Push it onto
2958
    /* The final varint of the key is different from R.  Push it onto
2959
    ** the stack.  (The record number of an entry that violates a UNITQUE
2959
    ** the stack.  (The record number of an entry that violates a UNIQUE
2960
    ** constraint.)
2960
    ** constraint.)
2961
    */
2961
    */
2962
    pTos++;
2962
    pTos++;
(-)koffice/kexi/3rdparty/kexisql3/src/where.c (-5 / +5 lines)
Lines 170-176 Link Here
170
#define WHERE_IDX_ONLY       0x0800   /* Use index only - omit table */
170
#define WHERE_IDX_ONLY       0x0800   /* Use index only - omit table */
171
#define WHERE_ORDERBY        0x1000   /* Output will appear in correct order */
171
#define WHERE_ORDERBY        0x1000   /* Output will appear in correct order */
172
#define WHERE_REVERSE        0x2000   /* Scan in reverse order */
172
#define WHERE_REVERSE        0x2000   /* Scan in reverse order */
173
#define WHERE_UNITQUE         0x4000   /* Selects no more than one row */
173
#define WHERE_UNIQUE         0x4000   /* Selects no more than one row */
174
174
175
/*
175
/*
176
** Initialize a preallocated WhereClause structure.
176
** Initialize a preallocated WhereClause structure.
Lines 747-753 Link Here
747
** clause and the match can still be a success.
747
** clause and the match can still be a success.
748
**
748
**
749
** All terms of the ORDER BY that match against the index must be either
749
** All terms of the ORDER BY that match against the index must be either
750
** ASC or DESC.  (Terms of the ORDER BY clause past the end of a UNITQUE
750
** ASC or DESC.  (Terms of the ORDER BY clause past the end of a UNIQUE
751
** index do not need to satisfy this constraint.)  The *pbRev value is
751
** index do not need to satisfy this constraint.)  The *pbRev value is
752
** set to 1 if the ORDER BY clause is all DESC and it is set to 0 if
752
** set to 1 if the ORDER BY clause is all DESC and it is set to 0 if
753
** the ORDER BY clause is all ASC.
753
** the ORDER BY clause is all ASC.
Lines 915-921 Link Here
915
    if( pTerm->operator & WO_EQ ){
915
    if( pTerm->operator & WO_EQ ){
916
      /* Rowid== is always the best pick.  Look no further.  Because only
916
      /* Rowid== is always the best pick.  Look no further.  Because only
917
      ** a single row is generated, output is always in sorted order */
917
      ** a single row is generated, output is always in sorted order */
918
      *pFlags = WHERE_ROWID_EQ | WHERE_UNITQUE;
918
      *pFlags = WHERE_ROWID_EQ | WHERE_UNIQUE;
919
      *pnEq = 1;
919
      *pnEq = 1;
920
      TRACE(("... best is rowid\n"));
920
      TRACE(("... best is rowid\n"));
921
      return 0.0;
921
      return 0.0;
Lines 1007-1013 Link Here
1007
    nEq = i;
1007
    nEq = i;
1008
    if( pProbe->onError!=OE_None && (flags & WHERE_COLUMN_IN)==0
1008
    if( pProbe->onError!=OE_None && (flags & WHERE_COLUMN_IN)==0
1009
         && nEq==pProbe->nColumn ){
1009
         && nEq==pProbe->nColumn ){
1010
      flags |= WHERE_UNITQUE;
1010
      flags |= WHERE_UNIQUE;
1011
    }
1011
    }
1012
    TRACE(("...... nEq=%d inMult=%.9g cost=%.9g\n", nEq, inMultiplier, cost));
1012
    TRACE(("...... nEq=%d inMult=%.9g cost=%.9g\n", nEq, inMultiplier, cost));
1013
1013
Lines 1514-1520 Link Here
1514
  /* If the total query only selects a single row, then the ORDER BY
1514
  /* If the total query only selects a single row, then the ORDER BY
1515
  ** clause is irrelevant.
1515
  ** clause is irrelevant.
1516
  */
1516
  */
1517
  if( (andFlags & WHERE_UNITQUE)!=0 && ppOrderBy ){
1517
  if( (andFlags & WHERE_UNIQUE)!=0 && ppOrderBy ){
1518
    *ppOrderBy = 0;
1518
    *ppOrderBy = 0;
1519
  }
1519
  }
1520
1520
(-)koffice/kexi/kexidb/connection.cpp (-6 / +6 lines)
Lines 671-677 Link Here
671
671
672
bool Connection::useTemporaryDatabaseIfNeeded(TQString &tmpdbName)
672
bool Connection::useTemporaryDatabaseIfNeeded(TQString &tmpdbName)
673
{
673
{
674
	if (!m_driver->isFileDriver() && m_driver->beh->USING_DATABASE_RETQUIRED_TO_CONNECT
674
	if (!m_driver->isFileDriver() && m_driver->beh->USING_DATABASE_REQUIRED_TO_CONNECT
675
	 && !isDatabaseUsed()) {
675
	 && !isDatabaseUsed()) {
676
		//we have no db used, but it is required by engine to have used any!
676
		//we have no db used, but it is required by engine to have used any!
677
		tmpdbName = anyAvailableDatabaseName();
677
		tmpdbName = anyAvailableDatabaseName();
Lines 884-891 Link Here
884
			sql += ", ";
884
			sql += ", ";
885
		TQString v = escapeIdentifier(field->name()) + " ";
885
		TQString v = escapeIdentifier(field->name()) + " ";
886
		const bool autoinc = field->isAutoIncrement();
886
		const bool autoinc = field->isAutoIncrement();
887
		const bool pk = field->isPrimaryKey() || (autoinc && m_driver->beh->AUTO_INCREMENT_RETQUIRES_PK);
887
		const bool pk = field->isPrimaryKey() || (autoinc && m_driver->beh->AUTO_INCREMENT_REQUIRES_PK);
888
//TODO: warning: ^^^^^ this allows only one autonumber per table when AUTO_INCREMENT_RETQUIRES_PK==true!
888
//TODO: warning: ^^^^^ this allows only one autonumber per table when AUTO_INCREMENT_REQUIRES_PK==true!
889
		if (autoinc && m_driver->beh->SPECIAL_AUTO_INCREMENT_DEF) {
889
		if (autoinc && m_driver->beh->SPECIAL_AUTO_INCREMENT_DEF) {
890
			if (pk)
890
			if (pk)
891
				v += m_driver->beh->AUTO_INCREMENT_TYPE + " " + m_driver->beh->AUTO_INCREMENT_PK_FIELD_OPTION;
891
				v += m_driver->beh->AUTO_INCREMENT_TYPE + " " + m_driver->beh->AUTO_INCREMENT_PK_FIELD_OPTION;
Lines 918-924 Link Here
918
				if (pk)
918
				if (pk)
919
					v += " PRIMARY KEY";
919
					v += " PRIMARY KEY";
920
			if (!pk && field->isUniqueKey())
920
			if (!pk && field->isUniqueKey())
921
				v += " UNITQUE";
921
				v += " UNIQUE";
922
///@todo IS this ok for all engines?: if (!autoinc && !field->isPrimaryKey() && field->isNotNull())
922
///@todo IS this ok for all engines?: if (!autoinc && !field->isPrimaryKey() && field->isNotNull())
923
			if (!autoinc && !pk && field->isNotNull())
923
			if (!autoinc && !pk && field->isNotNull())
924
				v += " NOT NULL"; //only add not null option if no autocommit is set
924
				v += " NOT NULL"; //only add not null option if no autocommit is set
Lines 2481-2487 Link Here
2481
{
2481
{
2482
	KexiDB::Cursor *cursor;
2482
	KexiDB::Cursor *cursor;
2483
	//optimization
2483
	//optimization
2484
	if (m_driver->beh->SELECT_1_SUBTQUERY_SUPPORTED) {
2484
	if (m_driver->beh->SELECT_1_SUBQUERY_SUPPORTED) {
2485
		//this is at least for sqlite
2485
		//this is at least for sqlite
2486
		if (addLimitTo1 && sql.left(6).upper() == "SELECT")
2486
		if (addLimitTo1 && sql.left(6).upper() == "SELECT")
2487
			m_sql = TQString("SELECT 1 FROM (") + sql + ") LIMIT 1"; // is this safe?;
2487
			m_sql = TQString("SELECT 1 FROM (") + sql + ") LIMIT 1"; // is this safe?;
Lines 3279-3285 Link Here
3279
	if (b.isEmpty()) {
3279
	if (b.isEmpty()) {
3280
		// empty row inserting requested:
3280
		// empty row inserting requested:
3281
		if (!getROWID && !pkey) {
3281
		if (!getROWID && !pkey) {
3282
			KexiDBWarn << "MASTER TABLE's PKEY RETQUIRED FOR INSERTING EMPTY ROWS: INSERT CANCELLED" << endl;
3282
			KexiDBWarn << "MASTER TABLE's PKEY REQUIRED FOR INSERTING EMPTY ROWS: INSERT CANCELLED" << endl;
3283
			setError(ERR_INSERT_NO_MASTER_TABLES_PKEY,
3283
			setError(ERR_INSERT_NO_MASTER_TABLES_PKEY,
3284
				i18n("Could not insert row because master table has no primary key defined."));
3284
				i18n("Could not insert row because master table has no primary key defined."));
3285
			return false;
3285
			return false;
(-)koffice/kexi/kexidb/cursor.cpp (-1 / +1 lines)
Lines 166-172 Link Here
166
166
167
//luci:	WHAT_EXACTLY_SHOULD_THAT_BE?
167
//luci:	WHAT_EXACTLY_SHOULD_THAT_BE?
168
//	if (!m_readAhead) // jowenn: to ensure before first state, without cluttering implementation code
168
//	if (!m_readAhead) // jowenn: to ensure before first state, without cluttering implementation code
169
	if (m_conn->driver()->beh->_1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY) {
169
	if (m_conn->driver()->beh->_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY) {
170
//		KexiDBDbg << "READ AHEAD:" << endl;
170
//		KexiDBDbg << "READ AHEAD:" << endl;
171
		m_readAhead = getNextRecord(); //true if any record in this query
171
		m_readAhead = getNextRecord(); //true if any record in this query
172
//		KexiDBDbg << "READ AHEAD = " << m_readAhead << endl;
172
//		KexiDBDbg << "READ AHEAD = " << m_readAhead << endl;
(-)koffice/kexi/kexidb/driver.cpp (-6 / +6 lines)
Lines 49-60 Link Here
49
	, AUTO_INCREMENT_FIELD_OPTION("AUTO_INCREMENT")
49
	, AUTO_INCREMENT_FIELD_OPTION("AUTO_INCREMENT")
50
	, AUTO_INCREMENT_PK_FIELD_OPTION("AUTO_INCREMENT PRIMARY KEY")
50
	, AUTO_INCREMENT_PK_FIELD_OPTION("AUTO_INCREMENT PRIMARY KEY")
51
	, SPECIAL_AUTO_INCREMENT_DEF(false)
51
	, SPECIAL_AUTO_INCREMENT_DEF(false)
52
	, AUTO_INCREMENT_RETQUIRES_PK(false)
52
	, AUTO_INCREMENT_REQUIRES_PK(false)
53
	, ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE(false)
53
	, ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE(false)
54
	, TQUOTATION_MARKS_FOR_IDENTIFIER('"')
54
	, QUOTATION_MARKS_FOR_IDENTIFIER('"')
55
	, USING_DATABASE_RETQUIRED_TO_CONNECT(true)
55
	, USING_DATABASE_REQUIRED_TO_CONNECT(true)
56
	, _1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY(false)
56
	, _1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY(false)
57
	, SELECT_1_SUBTQUERY_SUPPORTED(false)
57
	, SELECT_1_SUBQUERY_SUPPORTED(false)
58
	, SQL_KEYWORDS(0)
58
	, SQL_KEYWORDS(0)
59
{
59
{
60
}
60
}
Lines 350-356 Link Here
350
		return quote + TQCString(str).replace( quote, "\"\"" ) + quote;
350
		return quote + TQCString(str).replace( quote, "\"\"" ) + quote;
351
	}
351
	}
352
	else if (needOuterQuotes) {
352
	else if (needOuterQuotes) {
353
		const char quote = beh->TQUOTATION_MARKS_FOR_IDENTIFIER.latin1();
353
		const char quote = beh->QUOTATION_MARKS_FOR_IDENTIFIER.latin1();
354
		return quote + drv_escapeIdentifier(str) + quote;
354
		return quote + drv_escapeIdentifier(str) + quote;
355
	} else {
355
	} else {
356
		return drv_escapeIdentifier(str);
356
		return drv_escapeIdentifier(str);
(-)koffice/kexi/kexidb/driver.h (-1 / +1 lines)
Lines 319-325 Link Here
319
		 Implement escaping for any character like " or ' as your 
319
		 Implement escaping for any character like " or ' as your 
320
		 database engine requires. Do not append or prepend any quotation 
320
		 database engine requires. Do not append or prepend any quotation 
321
		 marks characters - it is automatically done by escapeIdentifier() using
321
		 marks characters - it is automatically done by escapeIdentifier() using
322
		 DriverBehaviour::TQUOTATION_MARKS_FOR_IDENTIFIER.
322
		 DriverBehaviour::QUOTATION_MARKS_FOR_IDENTIFIER.
323
		*/
323
		*/
324
		virtual TQString drv_escapeIdentifier( const TQString& str ) const = 0;
324
		virtual TQString drv_escapeIdentifier( const TQString& str ) const = 0;
325
		
325
		
(-)koffice/kexi/kexidb/driver_p.h (-5 / +5 lines)
Lines 72-78 Link Here
72
72
73
	/*! True if autoincrement requires field to be declared as primary key.
73
	/*! True if autoincrement requires field to be declared as primary key.
74
	 This is true for SQLite. False by default. */
74
	 This is true for SQLite. False by default. */
75
	bool AUTO_INCREMENT_RETQUIRES_PK : 1;
75
	bool AUTO_INCREMENT_REQUIRES_PK : 1;
76
76
77
	/*! Name of a field (or built-in function) with autoincremented unique value,
77
	/*! Name of a field (or built-in function) with autoincremented unique value,
78
	 typically returned by Connection::drv_lastInsertRowID().
78
	 typically returned by Connection::drv_lastInsertRowID().
Lines 114-120 Link Here
114
	/*! Quotation marks used for escaping identifier (see Driver::escapeIdentifier()).
114
	/*! Quotation marks used for escaping identifier (see Driver::escapeIdentifier()).
115
	 Default value is '"'. Change it for your driver.
115
	 Default value is '"'. Change it for your driver.
116
	*/
116
	*/
117
	TQChar TQUOTATION_MARKS_FOR_IDENTIFIER;
117
	TQChar QUOTATION_MARKS_FOR_IDENTIFIER;
118
	
118
	
119
	/*! True if using database is requied to perform real connection.
119
	/*! True if using database is requied to perform real connection.
120
	 This is true for may engines, e.g. for PostgreSQL, where connections 
120
	 This is true for may engines, e.g. for PostgreSQL, where connections 
Lines 122-137 Link Here
122
	 This flag is unused for file-based db drivers,
122
	 This flag is unused for file-based db drivers,
123
	 by default set to true and used for all other db drivers.
123
	 by default set to true and used for all other db drivers.
124
	*/
124
	*/
125
	bool USING_DATABASE_RETQUIRED_TO_CONNECT : 1;
125
	bool USING_DATABASE_REQUIRED_TO_CONNECT : 1;
126
126
127
	/*! True if before we know whether the fetched result of executed query
127
	/*! True if before we know whether the fetched result of executed query
128
	 is empty or not, we need to fetch first record. Particularly, it's true for SQLite.
128
	 is empty or not, we need to fetch first record. Particularly, it's true for SQLite.
129
	 The flag is used in Cursor::open(). By default this flag is false. */
129
	 The flag is used in Cursor::open(). By default this flag is false. */
130
	bool _1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY : 1;
130
	bool _1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY : 1;
131
131
132
	/*! True if "SELECT 1 from (subquery)" is supported. False by default.
132
	/*! True if "SELECT 1 from (subquery)" is supported. False by default.
133
	 Used in Connection::resultExists() for optimization. It's set to true for SQLite driver. */
133
	 Used in Connection::resultExists() for optimization. It's set to true for SQLite driver. */
134
	bool SELECT_1_SUBTQUERY_SUPPORTED : 1;
134
	bool SELECT_1_SUBQUERY_SUPPORTED : 1;
135
135
136
	/*! Keywords that need to be escaped for the driver.  Set this before calling
136
	/*! Keywords that need to be escaped for the driver.  Set this before calling
137
	    Driver::initSQLKeywords. */
137
	    Driver::initSQLKeywords. */
(-)koffice/kexi/kexidb/drivers/mySQL/mysqldriver.cpp (-3 / +3 lines)
Lines 63-71 Link Here
63
63
64
	beh->ROW_ID_FIELD_NAME="LAST_INSERT_ID()";
64
	beh->ROW_ID_FIELD_NAME="LAST_INSERT_ID()";
65
	beh->ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE=true;
65
	beh->ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE=true;
66
	beh->_1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=false;
66
	beh->_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=false;
67
	beh->USING_DATABASE_RETQUIRED_TO_CONNECT=false;
67
	beh->USING_DATABASE_REQUIRED_TO_CONNECT=false;
68
	beh->TQUOTATION_MARKS_FOR_IDENTIFIER='`';
68
	beh->QUOTATION_MARKS_FOR_IDENTIFIER='`';
69
	beh->SQL_KEYWORDS = keywords;
69
	beh->SQL_KEYWORDS = keywords;
70
	initSQLKeywords(331);
70
	initSQLKeywords(331);
71
	
71
	
(-)koffice/kexi/kexidb/drivers/mySQL/mysqlkeywords.cpp (-1 / +1 lines)
Lines 177-183 Link Here
177
		"MASTER_SSL_KEY",
177
		"MASTER_SSL_KEY",
178
		"MASTER_USER",
178
		"MASTER_USER",
179
		"MAX_CONNECTIONS_PER_HOUR",
179
		"MAX_CONNECTIONS_PER_HOUR",
180
		"MAX_TQUERIES_PER_HOUR",
180
		"MAX_QUERIES_PER_HOUR",
181
		"MAX_ROWS",
181
		"MAX_ROWS",
182
		"MAX_UPDATES_PER_HOUR",
182
		"MAX_UPDATES_PER_HOUR",
183
		"MEDIUM",
183
		"MEDIUM",
(-)koffice/kexi/kexidb/drivers/pqxx/pqxxcursor.h (-2 / +2 lines)
Lines 17-24 Link Here
17
 * Boston, MA 02110-1301, USA.
17
 * Boston, MA 02110-1301, USA.
18
*/
18
*/
19
19
20
#ifndef KEXIDB_CURSOR_PTQXX_H
20
#ifndef KEXIDB_CURSOR_PQXX_H
21
#define KEXIDB_CURSOR_PTQXX_H
21
#define KEXIDB_CURSOR_PQXX_H
22
22
23
#include <kexidb/cursor.h>
23
#include <kexidb/cursor.h>
24
#include <kexidb/connection.h>
24
#include <kexidb/connection.h>
(-)koffice/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp (-1 / +1 lines)
Lines 47-53 Link Here
47
	beh->AUTO_INCREMENT_FIELD_OPTION = "";
47
	beh->AUTO_INCREMENT_FIELD_OPTION = "";
48
	beh->AUTO_INCREMENT_PK_FIELD_OPTION = "PRIMARY KEY";
48
	beh->AUTO_INCREMENT_PK_FIELD_OPTION = "PRIMARY KEY";
49
	beh->ALWAYS_AVAILABLE_DATABASE_NAME = "template1";
49
	beh->ALWAYS_AVAILABLE_DATABASE_NAME = "template1";
50
	beh->TQUOTATION_MARKS_FOR_IDENTIFIER = '"';
50
	beh->QUOTATION_MARKS_FOR_IDENTIFIER = '"';
51
	beh->SQL_KEYWORDS = keywords;
51
	beh->SQL_KEYWORDS = keywords;
52
	initSQLKeywords(233);
52
	initSQLKeywords(233);
53
53
(-)koffice/kexi/kexidb/drivers/sqlite/sqlitedriver.cpp (-4 / +4 lines)
Lines 66-76 Link Here
66
	beh->AUTO_INCREMENT_FIELD_OPTION = ""; //not available
66
	beh->AUTO_INCREMENT_FIELD_OPTION = ""; //not available
67
	beh->AUTO_INCREMENT_TYPE = "INTEGER";
67
	beh->AUTO_INCREMENT_TYPE = "INTEGER";
68
	beh->AUTO_INCREMENT_PK_FIELD_OPTION = "PRIMARY KEY";
68
	beh->AUTO_INCREMENT_PK_FIELD_OPTION = "PRIMARY KEY";
69
	beh->AUTO_INCREMENT_RETQUIRES_PK = true;
69
	beh->AUTO_INCREMENT_REQUIRES_PK = true;
70
	beh->ROW_ID_FIELD_NAME = "OID";
70
	beh->ROW_ID_FIELD_NAME = "OID";
71
	beh->_1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=true;
71
	beh->_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=true;
72
	beh->TQUOTATION_MARKS_FOR_IDENTIFIER='"';
72
	beh->QUOTATION_MARKS_FOR_IDENTIFIER='"';
73
	beh->SELECT_1_SUBTQUERY_SUPPORTED = true;
73
	beh->SELECT_1_SUBQUERY_SUPPORTED = true;
74
	beh->SQL_KEYWORDS = keywords;
74
	beh->SQL_KEYWORDS = keywords;
75
	initSQLKeywords(29);
75
	initSQLKeywords(29);
76
76
(-)koffice/kexi/kexidb/expression.cpp (-1 / +1 lines)
Lines 568-574 Link Here
568
568
569
//=========================================
569
//=========================================
570
QueryParameterExpr::QueryParameterExpr(const TQString& message)
570
QueryParameterExpr::QueryParameterExpr(const TQString& message)
571
: ConstExpr( TQUERY_PARAMETER, message )
571
: ConstExpr( QUERY_PARAMETER, message )
572
, m_type(Field::Text)
572
, m_type(Field::Text)
573
{
573
{
574
	m_cl = KexiDBExpr_QueryParameter;
574
	m_cl = KexiDBExpr_QueryParameter;
(-)koffice/kexi/kexidb/field.cpp (-1 / +1 lines)
Lines 598-604 Link Here
598
	if (m_constraints & Field::AutoInc)
598
	if (m_constraints & Field::AutoInc)
599
		dbg += " AUTOINC";
599
		dbg += " AUTOINC";
600
	if (m_constraints & Field::Unique)
600
	if (m_constraints & Field::Unique)
601
		dbg += " UNITQUE";
601
		dbg += " UNIQUE";
602
	if (m_constraints & Field::PrimaryKey)
602
	if (m_constraints & Field::PrimaryKey)
603
		dbg += " PKEY";
603
		dbg += " PKEY";
604
	if (m_constraints & Field::ForeignKey)
604
	if (m_constraints & Field::ForeignKey)
(-)koffice/kexi/kexidb/indexschema.cpp (-1 / +1 lines)
Lines 157-163 Link Here
157
		+ (m_isForeignKey ? "FOREIGN KEY " : "")
157
		+ (m_isForeignKey ? "FOREIGN KEY " : "")
158
		+ (m_isAutoGenerated ? "AUTOGENERATED " : "")
158
		+ (m_isAutoGenerated ? "AUTOGENERATED " : "")
159
		+ (m_primary ? "PRIMARY " : "")
159
		+ (m_primary ? "PRIMARY " : "")
160
		+ ((!m_primary) && m_unique ? "UNITQUE " : "")
160
		+ ((!m_primary) && m_unique ? "UNIQUE " : "")
161
		+ FieldList::debugString();
161
		+ FieldList::debugString();
162
}
162
}
163
163
(-)koffice/kexi/kexidb/indexschema.h (-5 / +5 lines)
Lines 118-124 Link Here
118
			Auto-generated index is one-field index
118
			Auto-generated index is one-field index
119
			that was automatically generated 
119
			that was automatically generated 
120
			for CREATE TABLE statement when the field has 
120
			for CREATE TABLE statement when the field has 
121
			UNITQUE or PRIMARY KEY constraint enabled.
121
			UNIQUE or PRIMARY KEY constraint enabled.
122
			
122
			
123
			Any newly created IndexSchema object 
123
			Any newly created IndexSchema object 
124
			has this flag set to false.
124
			has this flag set to false.
Lines 137-152 Link Here
137
		
137
		
138
		/*! Sets PRIMARY KEY flag. \sa isPrimary().
138
		/*! Sets PRIMARY KEY flag. \sa isPrimary().
139
		 Note: Setting PRIMARY KEY on (true), 
139
		 Note: Setting PRIMARY KEY on (true), 
140
		 UNITQUE flag will be also implicity set. */
140
		 UNIQUE flag will be also implicity set. */
141
		void setPrimaryKey(bool set);
141
		void setPrimaryKey(bool set);
142
142
143
		/*! \return true if this is unique index. 
143
		/*! \return true if this is unique index. 
144
		 This can be one or multifield. */
144
		 This can be one or multifield. */
145
		bool isUnique() const;
145
		bool isUnique() const;
146
		
146
		
147
		/*! Sets UNITQUE flag. \sa isUnique(). 
147
		/*! Sets UNIQUE flag. \sa isUnique(). 
148
		 Note: Setting UNITQUE off (false), PRIMARY KEY flag will 
148
		 Note: Setting UNIQUE off (false), PRIMARY KEY flag will 
149
		 be also implicity set off, because this UNITQUE 
149
		 be also implicity set off, because this UNIQUE 
150
		 is the requirement for PRIMARY KEYS. */
150
		 is the requirement for PRIMARY KEYS. */
151
		void setUnique(bool set);
151
		void setUnique(bool set);
152
152
(-)koffice/kexi/kexidb/keywords.cpp (-1 / +1 lines)
Lines 82-88 Link Here
82
		"THEN",
82
		"THEN",
83
		"TRANSACTION",
83
		"TRANSACTION",
84
		"UNION",
84
		"UNION",
85
		"UNITQUE",
85
		"UNIQUE",
86
		"UPDATE",
86
		"UPDATE",
87
		"USING",
87
		"USING",
88
		"VALUES",
88
		"VALUES",
(-)koffice/kexi/kexidb/parser/sqlparser.cpp (-18 / +18 lines)
Lines 174-185 Link Here
174
     DISTINCT = 363,
174
     DISTINCT = 363,
175
     DOMAIN_TOKEN = 364,
175
     DOMAIN_TOKEN = 364,
176
     SQL_DOUBLE = 365,
176
     SQL_DOUBLE = 365,
177
     DOUBLE_TQUOTED_STRING = 366,
177
     DOUBLE_QUOTED_STRING = 366,
178
     DROP = 367,
178
     DROP = 367,
179
     ELSE = 368,
179
     ELSE = 368,
180
     END = 369,
180
     END = 369,
181
     END_EXEC = 370,
181
     END_EXEC = 370,
182
     ETQUAL = 371,
182
     EQUAL = 371,
183
     ESCAPE = 372,
183
     ESCAPE = 372,
184
     EXCEPT = 373,
184
     EXCEPT = 373,
185
     SQL_EXCEPTION = 374,
185
     SQL_EXCEPTION = 374,
Lines 296-302 Link Here
296
     PARTIAL = 485,
296
     PARTIAL = 485,
297
     SQL_PASCAL = 486,
297
     SQL_PASCAL = 486,
298
     PERSISTENT = 487,
298
     PERSISTENT = 487,
299
     CTQL_PI = 488,
299
     CQL_PI = 488,
300
     PLI = 489,
300
     PLI = 489,
301
     POSITION = 490,
301
     POSITION = 490,
302
     PRECISION = 491,
302
     PRECISION = 491,
Lines 308-315 Link Here
308
     PROCEDURE = 497,
308
     PROCEDURE = 497,
309
     PRODUCT = 498,
309
     PRODUCT = 498,
310
     PUBLIC = 499,
310
     PUBLIC = 499,
311
     TQUARTER = 500,
311
     QUARTER = 500,
312
     TQUIT = 501,
312
     QUIT = 501,
313
     RAND = 502,
313
     RAND = 502,
314
     READ_ONLY = 503,
314
     READ_ONLY = 503,
315
     REAL = 504,
315
     REAL = 504,
Lines 381-387 Link Here
381
     TWO_DIGITS = 570,
381
     TWO_DIGITS = 570,
382
     UCASE = 571,
382
     UCASE = 571,
383
     UNION = 572,
383
     UNION = 572,
384
     UNITQUE = 573,
384
     UNIQUE = 573,
385
     SQL_UNKNOWN = 574,
385
     SQL_UNKNOWN = 574,
386
     UPDATE = 575,
386
     UPDATE = 575,
387
     UPPER = 576,
387
     UPPER = 576,
Lines 389-395 Link Here
389
     USER = 578,
389
     USER = 578,
390
     IDENTIFIER = 579,
390
     IDENTIFIER = 579,
391
     IDENTIFIER_DOT_ASTERISK = 580,
391
     IDENTIFIER_DOT_ASTERISK = 580,
392
     TQUERY_PARAMETER = 581,
392
     QUERY_PARAMETER = 581,
393
     USING = 582,
393
     USING = 582,
394
     VALUE = 583,
394
     VALUE = 583,
395
     VALUES = 584,
395
     VALUES = 584,
Lines 524-535 Link Here
524
#define DISTINCT 363
524
#define DISTINCT 363
525
#define DOMAIN_TOKEN 364
525
#define DOMAIN_TOKEN 364
526
#define SQL_DOUBLE 365
526
#define SQL_DOUBLE 365
527
#define DOUBLE_TQUOTED_STRING 366
527
#define DOUBLE_QUOTED_STRING 366
528
#define DROP 367
528
#define DROP 367
529
#define ELSE 368
529
#define ELSE 368
530
#define END 369
530
#define END 369
531
#define END_EXEC 370
531
#define END_EXEC 370
532
#define ETQUAL 371
532
#define EQUAL 371
533
#define ESCAPE 372
533
#define ESCAPE 372
534
#define EXCEPT 373
534
#define EXCEPT 373
535
#define SQL_EXCEPTION 374
535
#define SQL_EXCEPTION 374
Lines 646-652 Link Here
646
#define PARTIAL 485
646
#define PARTIAL 485
647
#define SQL_PASCAL 486
647
#define SQL_PASCAL 486
648
#define PERSISTENT 487
648
#define PERSISTENT 487
649
#define CTQL_PI 488
649
#define CQL_PI 488
650
#define PLI 489
650
#define PLI 489
651
#define POSITION 490
651
#define POSITION 490
652
#define PRECISION 491
652
#define PRECISION 491
Lines 658-665 Link Here
658
#define PROCEDURE 497
658
#define PROCEDURE 497
659
#define PRODUCT 498
659
#define PRODUCT 498
660
#define PUBLIC 499
660
#define PUBLIC 499
661
#define TQUARTER 500
661
#define QUARTER 500
662
#define TQUIT 501
662
#define QUIT 501
663
#define RAND 502
663
#define RAND 502
664
#define READ_ONLY 503
664
#define READ_ONLY 503
665
#define REAL 504
665
#define REAL 504
Lines 731-737 Link Here
731
#define TWO_DIGITS 570
731
#define TWO_DIGITS 570
732
#define UCASE 571
732
#define UCASE 571
733
#define UNION 572
733
#define UNION 572
734
#define UNITQUE 573
734
#define UNIQUE 573
735
#define SQL_UNKNOWN 574
735
#define SQL_UNKNOWN 574
736
#define UPDATE 575
736
#define UPDATE 575
737
#define UPPER 576
737
#define UPPER 576
Lines 739-745 Link Here
739
#define USER 578
739
#define USER 578
740
#define IDENTIFIER 579
740
#define IDENTIFIER 579
741
#define IDENTIFIER_DOT_ASTERISK 580
741
#define IDENTIFIER_DOT_ASTERISK 580
742
#define TQUERY_PARAMETER 581
742
#define QUERY_PARAMETER 581
743
#define USING 582
743
#define USING 582
744
#define VALUE 583
744
#define VALUE 583
745
#define VALUES 584
745
#define VALUES 584
Lines 1290-1297 Link Here
1290
  "DEC", "DECLARE", "DEFAULT", "DEFERRABLE", "DEFERRED", "SQL_DELETE",
1290
  "DEC", "DECLARE", "DEFAULT", "DEFERRABLE", "DEFERRED", "SQL_DELETE",
1291
  "DESC", "DESCRIBE", "DESCRIPTOR", "DIAGNOSTICS", "DICTIONARY",
1291
  "DESC", "DESCRIBE", "DESCRIPTOR", "DIAGNOSTICS", "DICTIONARY",
1292
  "DIRECTORY", "DISCONNECT", "DISPLACEMENT", "DISTINCT", "DOMAIN_TOKEN",
1292
  "DIRECTORY", "DISCONNECT", "DISPLACEMENT", "DISTINCT", "DOMAIN_TOKEN",
1293
  "SQL_DOUBLE", "DOUBLE_TQUOTED_STRING", "DROP", "ELSE", "END", "END_EXEC",
1293
  "SQL_DOUBLE", "DOUBLE_QUOTED_STRING", "DROP", "ELSE", "END", "END_EXEC",
1294
  "ETQUAL", "ESCAPE", "EXCEPT", "SQL_EXCEPTION", "EXEC", "EXECUTE",
1294
  "EQUAL", "ESCAPE", "EXCEPT", "SQL_EXCEPTION", "EXEC", "EXECUTE",
1295
  "EXISTS", "EXP", "EXPONENT", "EXTERNAL", "EXTRACT", "SQL_FALSE", "FETCH",
1295
  "EXISTS", "EXP", "EXPONENT", "EXTERNAL", "EXTRACT", "SQL_FALSE", "FETCH",
1296
  "FIRST", "SQL_FLOAT", "FLOOR", "FN", "FOR", "FOREIGN", "FORTRAN",
1296
  "FIRST", "SQL_FLOAT", "FLOOR", "FN", "FOR", "FOREIGN", "FORTRAN",
1297
  "FOUND", "FOUR_DIGITS", "FROM", "FULL", "GET", "GLOBAL", "GO", "GOTO",
1297
  "FOUND", "FOUR_DIGITS", "FROM", "FULL", "GET", "GLOBAL", "GO", "GOTO",
Lines 1308-1314 Link Here
1308
  "NOW", "SQL_NULL", "SQL_IS", "SQL_IS_NULL", "SQL_IS_NOT_NULL", "NULLIF",
1308
  "NOW", "SQL_NULL", "SQL_IS", "SQL_IS_NULL", "SQL_IS_NOT_NULL", "NULLIF",
1309
  "NUMERIC", "OCTET_LENGTH", "ODBC", "OF", "SQL_OFF", "SQL_ON", "ONLY",
1309
  "NUMERIC", "OCTET_LENGTH", "ODBC", "OF", "SQL_OFF", "SQL_ON", "ONLY",
1310
  "OPEN", "OPTION", "OR", "ORDER", "OUTER", "OUTPUT", "OVERLAPS", "PAGE",
1310
  "OPEN", "OPTION", "OR", "ORDER", "OUTER", "OUTPUT", "OVERLAPS", "PAGE",
1311
  "PARTIAL", "SQL_PASCAL", "PERSISTENT", "CTQL_PI", "PLI", "POSITION",
1311
  "PARTIAL", "SQL_PASCAL", "PERSISTENT", "CQL_PI", "PLI", "POSITION",
1312
  "PRECISION", "PREPARE", "PRESERVE", "PRIMARY", "PRIOR", "PRIVILEGES",
1312
  "PRECISION", "PREPARE", "PRESERVE", "PRIMARY", "PRIOR", "PRIVILEGES",
1313
  "PROCEDURE", "PRODUCT", "PUBLIC", "QUARTER", "QUIT", "RAND", "READ_ONLY",
1313
  "PROCEDURE", "PRODUCT", "PUBLIC", "QUARTER", "QUIT", "RAND", "READ_ONLY",
1314
  "REAL", "REFERENCES", "REPEAT", "REPLACE", "RESTRICT", "REVOKE", "RIGHT",
1314
  "REAL", "REFERENCES", "REPEAT", "REPLACE", "RESTRICT", "REVOKE", "RIGHT",
Lines 1322-1328 Link Here
1322
  "TAN", "TEMPORARY", "THEN", "THREE_DIGITS", "TIME", "TIMESTAMP",
1322
  "TAN", "TEMPORARY", "THEN", "THREE_DIGITS", "TIME", "TIMESTAMP",
1323
  "TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TINYINT", "TO", "TO_CHAR",
1323
  "TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TINYINT", "TO", "TO_CHAR",
1324
  "TO_DATE", "TRANSACTION", "TRANSLATE", "TRANSLATION", "TRUNCATE",
1324
  "TO_DATE", "TRANSACTION", "TRANSLATE", "TRANSLATION", "TRUNCATE",
1325
  "GENERAL_TITLE", "TWO_DIGITS", "UCASE", "UNION", "UNITQUE", "SQL_UNKNOWN",
1325
  "GENERAL_TITLE", "TWO_DIGITS", "UCASE", "UNION", "UNIQUE", "SQL_UNKNOWN",
1326
  "UPDATE", "UPPER", "USAGE", "USER", "IDENTIFIER",
1326
  "UPDATE", "UPPER", "USAGE", "USER", "IDENTIFIER",
1327
  "IDENTIFIER_DOT_ASTERISK", "QUERY_PARAMETER", "USING", "VALUE", "VALUES",
1327
  "IDENTIFIER_DOT_ASTERISK", "QUERY_PARAMETER", "USING", "VALUE", "VALUES",
1328
  "VARBINARY", "VARCHAR", "VARYING", "VENDOR", "VIEW", "WEEK", "WHEN",
1328
  "VARBINARY", "VARCHAR", "VARYING", "VENDOR", "VIEW", "WEEK", "WHEN",
(-)koffice/kexi/kexidb/parser/sqlparser.h (-14 / +14 lines)
Lines 154-165 Link Here
154
     DISTINCT = 363,
154
     DISTINCT = 363,
155
     DOMAIN_TOKEN = 364,
155
     DOMAIN_TOKEN = 364,
156
     SQL_DOUBLE = 365,
156
     SQL_DOUBLE = 365,
157
     DOUBLE_TQUOTED_STRING = 366,
157
     DOUBLE_QUOTED_STRING = 366,
158
     DROP = 367,
158
     DROP = 367,
159
     ELSE = 368,
159
     ELSE = 368,
160
     END = 369,
160
     END = 369,
161
     END_EXEC = 370,
161
     END_EXEC = 370,
162
     ETQUAL = 371,
162
     EQUAL = 371,
163
     ESCAPE = 372,
163
     ESCAPE = 372,
164
     EXCEPT = 373,
164
     EXCEPT = 373,
165
     SQL_EXCEPTION = 374,
165
     SQL_EXCEPTION = 374,
Lines 276-282 Link Here
276
     PARTIAL = 485,
276
     PARTIAL = 485,
277
     SQL_PASCAL = 486,
277
     SQL_PASCAL = 486,
278
     PERSISTENT = 487,
278
     PERSISTENT = 487,
279
     CTQL_PI = 488,
279
     CQL_PI = 488,
280
     PLI = 489,
280
     PLI = 489,
281
     POSITION = 490,
281
     POSITION = 490,
282
     PRECISION = 491,
282
     PRECISION = 491,
Lines 288-295 Link Here
288
     PROCEDURE = 497,
288
     PROCEDURE = 497,
289
     PRODUCT = 498,
289
     PRODUCT = 498,
290
     PUBLIC = 499,
290
     PUBLIC = 499,
291
     TQUARTER = 500,
291
     QUARTER = 500,
292
     TQUIT = 501,
292
     QUIT = 501,
293
     RAND = 502,
293
     RAND = 502,
294
     READ_ONLY = 503,
294
     READ_ONLY = 503,
295
     REAL = 504,
295
     REAL = 504,
Lines 361-367 Link Here
361
     TWO_DIGITS = 570,
361
     TWO_DIGITS = 570,
362
     UCASE = 571,
362
     UCASE = 571,
363
     UNION = 572,
363
     UNION = 572,
364
     UNITQUE = 573,
364
     UNIQUE = 573,
365
     SQL_UNKNOWN = 574,
365
     SQL_UNKNOWN = 574,
366
     UPDATE = 575,
366
     UPDATE = 575,
367
     UPPER = 576,
367
     UPPER = 576,
Lines 369-375 Link Here
369
     USER = 578,
369
     USER = 578,
370
     IDENTIFIER = 579,
370
     IDENTIFIER = 579,
371
     IDENTIFIER_DOT_ASTERISK = 580,
371
     IDENTIFIER_DOT_ASTERISK = 580,
372
     TQUERY_PARAMETER = 581,
372
     QUERY_PARAMETER = 581,
373
     USING = 582,
373
     USING = 582,
374
     VALUE = 583,
374
     VALUE = 583,
375
     VALUES = 584,
375
     VALUES = 584,
Lines 504-515 Link Here
504
#define DISTINCT 363
504
#define DISTINCT 363
505
#define DOMAIN_TOKEN 364
505
#define DOMAIN_TOKEN 364
506
#define SQL_DOUBLE 365
506
#define SQL_DOUBLE 365
507
#define DOUBLE_TQUOTED_STRING 366
507
#define DOUBLE_QUOTED_STRING 366
508
#define DROP 367
508
#define DROP 367
509
#define ELSE 368
509
#define ELSE 368
510
#define END 369
510
#define END 369
511
#define END_EXEC 370
511
#define END_EXEC 370
512
#define ETQUAL 371
512
#define EQUAL 371
513
#define ESCAPE 372
513
#define ESCAPE 372
514
#define EXCEPT 373
514
#define EXCEPT 373
515
#define SQL_EXCEPTION 374
515
#define SQL_EXCEPTION 374
Lines 626-632 Link Here
626
#define PARTIAL 485
626
#define PARTIAL 485
627
#define SQL_PASCAL 486
627
#define SQL_PASCAL 486
628
#define PERSISTENT 487
628
#define PERSISTENT 487
629
#define CTQL_PI 488
629
#define CQL_PI 488
630
#define PLI 489
630
#define PLI 489
631
#define POSITION 490
631
#define POSITION 490
632
#define PRECISION 491
632
#define PRECISION 491
Lines 638-645 Link Here
638
#define PROCEDURE 497
638
#define PROCEDURE 497
639
#define PRODUCT 498
639
#define PRODUCT 498
640
#define PUBLIC 499
640
#define PUBLIC 499
641
#define TQUARTER 500
641
#define QUARTER 500
642
#define TQUIT 501
642
#define QUIT 501
643
#define RAND 502
643
#define RAND 502
644
#define READ_ONLY 503
644
#define READ_ONLY 503
645
#define REAL 504
645
#define REAL 504
Lines 711-717 Link Here
711
#define TWO_DIGITS 570
711
#define TWO_DIGITS 570
712
#define UCASE 571
712
#define UCASE 571
713
#define UNION 572
713
#define UNION 572
714
#define UNITQUE 573
714
#define UNIQUE 573
715
#define SQL_UNKNOWN 574
715
#define SQL_UNKNOWN 574
716
#define UPDATE 575
716
#define UPDATE 575
717
#define UPPER 576
717
#define UPPER 576
Lines 719-725 Link Here
719
#define USER 578
719
#define USER 578
720
#define IDENTIFIER 579
720
#define IDENTIFIER 579
721
#define IDENTIFIER_DOT_ASTERISK 580
721
#define IDENTIFIER_DOT_ASTERISK 580
722
#define TQUERY_PARAMETER 581
722
#define QUERY_PARAMETER 581
723
#define USING 582
723
#define USING 582
724
#define VALUE 583
724
#define VALUE 583
725
#define VALUES 584
725
#define VALUES 584
(-)koffice/kexi/kexidb/parser/sqlscanner.cpp (-1 / +1 lines)
Lines 1125-1131 Link Here
1125
	KexiDBDbg << "yytext: '" << yytext << "' (" << yyleng << ")" << endl;
1125
	KexiDBDbg << "yytext: '" << yytext << "' (" << yyleng << ")" << endl;
1126
	ECOUNT;
1126
	ECOUNT;
1127
	yylval.stringValue = new TQString(TQString::fromUtf8(yytext+1, yyleng-2));
1127
	yylval.stringValue = new TQString(TQString::fromUtf8(yytext+1, yyleng-2));
1128
	return TQUERY_PARAMETER;
1128
	return QUERY_PARAMETER;
1129
}
1129
}
1130
	YY_BREAK
1130
	YY_BREAK
1131
case 41:
1131
case 41:
(-)koffice/kexi/kexidb/queryschema.h (-2 / +2 lines)
Lines 17-24 Link Here
17
 * Boston, MA 02110-1301, USA.
17
 * Boston, MA 02110-1301, USA.
18
*/
18
*/
19
19
20
#ifndef KEXIDB_TQUERY_H
20
#ifndef KEXIDB_QUERY_H
21
#define KEXIDB_TQUERY_H
21
#define KEXIDB_QUERY_H
22
22
23
#include <tqvaluevector.h>
23
#include <tqvaluevector.h>
24
#include <tqstring.h>
24
#include <tqstring.h>
(-)koffice/kexi/kexidb/queryschemaparameter.h (-2 / +2 lines)
Lines 17-24 Link Here
17
 * Boston, MA 02110-1301, USA.
17
 * Boston, MA 02110-1301, USA.
18
*/
18
*/
19
19
20
#ifndef KEXIDB_TQUERYSCHEMAPARAMETER_H
20
#ifndef KEXIDB_QUERYSCHEMAPARAMETER_H
21
#define KEXIDB_TQUERYSCHEMAPARAMETER_H
21
#define KEXIDB_QUERYSCHEMAPARAMETER_H
22
22
23
#include "queryschema.h"
23
#include "queryschema.h"
24
24
(-)koffice/kexi/plugins/importexport/csv/kexicsvexport.cpp (-2 / +2 lines)
Lines 63-69 Link Here
63
	if (args.contains("textQuote"))
63
	if (args.contains("textQuote"))
64
		textQuote = args["textQuote"];
64
		textQuote = args["textQuote"];
65
	else
65
	else
66
		textQuote = (mode==File) ? KEXICSV_DEFAULT_FILE_TEXT_TQUOTE : KEXICSV_DEFAULT_CLIPBOARD_TEXT_TQUOTE;
66
		textQuote = (mode==File) ? KEXICSV_DEFAULT_FILE_TEXT_QUOTE : KEXICSV_DEFAULT_CLIPBOARD_TEXT_QUOTE;
67
67
68
	bool ok;
68
	bool ok;
69
	itemId = args["itemId"].toInt(&ok);
69
	itemId = args["itemId"].toInt(&ok);
Lines 95-101 Link Here
95
//! @todo look at rowCount whether the data is really large; 
95
//! @todo look at rowCount whether the data is really large; 
96
//!       if so: avoid copying to clipboard (or ask user) because of system memory
96
//!       if so: avoid copying to clipboard (or ask user) because of system memory
97
97
98
//! @todo OPTIMIZATION: use fieldsExpanded(true /*UNITQUE*/)
98
//! @todo OPTIMIZATION: use fieldsExpanded(true /*UNIQUE*/)
99
//! @todo OPTIMIZATION? (avoid multiple data retrieving) look for already fetched data within KexiProject..
99
//! @todo OPTIMIZATION? (avoid multiple data retrieving) look for already fetched data within KexiProject..
100
100
101
	KexiDB::QuerySchema* query = tableOrQuery.query();
101
	KexiDB::QuerySchema* query = tableOrQuery.query();
(-)koffice/kexi/plugins/importexport/csv/kexicsvexportwizard.cpp (-2 / +2 lines)
Lines 424-431 Link Here
424
TQString KexiCSVExportWizard::defaultTextQuote() const
424
TQString KexiCSVExportWizard::defaultTextQuote() const
425
{
425
{
426
	if (m_options.mode==KexiCSVExport::Clipboard)
426
	if (m_options.mode==KexiCSVExport::Clipboard)
427
		return KEXICSV_DEFAULT_CLIPBOARD_TEXT_TQUOTE;
427
		return KEXICSV_DEFAULT_CLIPBOARD_TEXT_QUOTE;
428
	return KEXICSV_DEFAULT_FILE_TEXT_TQUOTE;
428
	return KEXICSV_DEFAULT_FILE_TEXT_QUOTE;
429
}
429
}
430
430
431
#include "kexicsvexportwizard.moc"
431
#include "kexicsvexportwizard.moc"
(-)koffice/kexi/plugins/importexport/csv/kexicsvimportdialog.cpp (-1 / +1 lines)
Lines 156-162 Link Here
156
	m_cancelled( false ),
156
	m_cancelled( false ),
157
	m_adjustRows( true ),
157
	m_adjustRows( true ),
158
	m_startline( 0 ),
158
	m_startline( 0 ),
159
	m_textquote( TQString(KEXICSV_DEFAULT_FILE_TEXT_TQUOTE)[0] ),
159
	m_textquote( TQString(KEXICSV_DEFAULT_FILE_TEXT_QUOTE)[0] ),
160
	m_mode(mode),
160
	m_mode(mode),
161
	m_prevSelectedCol(-1),
161
	m_prevSelectedCol(-1),
162
	m_columnsAdjusted(false),
162
	m_columnsAdjusted(false),
(-)koffice/kexi/plugins/importexport/csv/kexicsvwidgets.h (-2 / +2 lines)
Lines 27-34 Link Here
27
class KActiveLabel;
27
class KActiveLabel;
28
class TQLabel;
28
class TQLabel;
29
29
30
#define KEXICSV_DEFAULT_FILE_TEXT_TQUOTE "\""
30
#define KEXICSV_DEFAULT_FILE_TEXT_QUOTE "\""
31
#define KEXICSV_DEFAULT_CLIPBOARD_TEXT_TQUOTE ""
31
#define KEXICSV_DEFAULT_CLIPBOARD_TEXT_QUOTE ""
32
#define KEXICSV_DEFAULT_FILE_DELIMITER ","
32
#define KEXICSV_DEFAULT_FILE_DELIMITER ","
33
#define KEXICSV_DEFAULT_CLIPBOARD_DELIMITER "\t"
33
#define KEXICSV_DEFAULT_CLIPBOARD_DELIMITER "\t"
34
#define KEXICSV_DEFAULT_FILE_DELIMITER_INDEX 0
34
#define KEXICSV_DEFAULT_FILE_DELIMITER_INDEX 0
(-)koffice/kexi/plugins/queries/kexidynamicqueryparameterdialog.h (-2 / +2 lines)
Lines 17-24 Link Here
17
 * Boston, MA 02110-1301, USA.
17
 * Boston, MA 02110-1301, USA.
18
 */
18
 */
19
19
20
#ifndef _KEXI_DYNAMIC_TQUERY_PARAMETER_DIALOG_H_
20
#ifndef _KEXI_DYNAMIC_QUERY_PARAMETER_DIALOG_H_
21
#define _KEXI_DYNAMIC_TQUERY_PARAMETER_DIALOG_H_
21
#define _KEXI_DYNAMIC_QUERY_PARAMETER_DIALOG_H_
22
22
23
23
24
#include <kdialogbase.h>
24
#include <kdialogbase.h>
(-)koffice/kexi/plugins/queries/kexiquerydesignerguieditor.cpp (-10 / +10 lines)
Lines 56-69 Link Here
56
56
57
#include "kexiquerypart.h"
57
#include "kexiquerypart.h"
58
58
59
//! @todo remove KEXI_NO_TQUERY_TOTALS later
59
//! @todo remove KEXI_NO_QUERY_TOTALS later
60
#define KEXI_NO_TQUERY_TOTALS
60
#define KEXI_NO_QUERY_TOTALS
61
61
62
//! indices for table columns
62
//! indices for table columns
63
#define COLUMN_ID_COLUMN 0
63
#define COLUMN_ID_COLUMN 0
64
#define COLUMN_ID_TABLE 1
64
#define COLUMN_ID_TABLE 1
65
#define COLUMN_ID_VISIBLE 2
65
#define COLUMN_ID_VISIBLE 2
66
#ifdef KEXI_NO_TQUERY_TOTALS
66
#ifdef KEXI_NO_QUERY_TOTALS
67
# define COLUMN_ID_SORTING 3
67
# define COLUMN_ID_SORTING 3
68
# define COLUMN_ID_CRITERIA 4
68
# define COLUMN_ID_CRITERIA 4
69
#else
69
#else
Lines 226-232 Link Here
226
	col3->field()->setNotNull( true );
226
	col3->field()->setNotNull( true );
227
	d->data->addColumn(col3);
227
	d->data->addColumn(col3);
228
228
229
#ifndef KEXI_NO_TQUERY_TOTALS
229
#ifndef KEXI_NO_QUERY_TOTALS
230
	KexiTableViewColumn *col4 = new KexiTableViewColumn("totals", KexiDB::Field::Enum, i18n("Totals"),
230
	KexiTableViewColumn *col4 = new KexiTableViewColumn("totals", KexiDB::Field::Enum, i18n("Totals"),
231
		i18n("Describes a way of computing totals for a given field or expression."));
231
		i18n("Describes a way of computing totals for a given field or expression."));
232
	TQValueVector<TQString> totalsTypes;
232
	TQValueVector<TQString> totalsTypes;
Lines 1200-1206 Link Here
1200
	(*newItem)[COLUMN_ID_COLUMN]=key;
1200
	(*newItem)[COLUMN_ID_COLUMN]=key;
1201
	(*newItem)[COLUMN_ID_TABLE]=tableName;
1201
	(*newItem)[COLUMN_ID_TABLE]=tableName;
1202
	(*newItem)[COLUMN_ID_VISIBLE]=TQVariant(visible, 1);
1202
	(*newItem)[COLUMN_ID_VISIBLE]=TQVariant(visible, 1);
1203
#ifndef KEXI_NO_TQUERY_TOTALS
1203
#ifndef KEXI_NO_QUERY_TOTALS
1204
	(*newItem)[COLUMN_ID_TOTALS]=TQVariant(0);
1204
	(*newItem)[COLUMN_ID_TOTALS]=TQVariant(0);
1205
#endif
1205
#endif
1206
	return newItem;
1206
	return newItem;
Lines 1422-1428 Link Here
1422
			d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(), false/*!allowSignals*/);
1422
			d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(), false/*!allowSignals*/);
1423
			d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible
1423
			d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible
1424
			d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, TQVariant());
1424
			d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, TQVariant());
1425
#ifndef KEXI_NO_TQUERY_TOTALS
1425
#ifndef KEXI_NO_QUERY_TOTALS
1426
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals
1426
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals
1427
#endif
1427
#endif
1428
			d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, TQVariant());//remove crit.
1428
			d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, TQVariant());//remove crit.
Lines 1500-1506 Link Here
1500
			}
1500
			}
1501
			d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(tableName), false/*!allowSignals*/);
1501
			d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(tableName), false/*!allowSignals*/);
1502
			d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(true,1));
1502
			d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(true,1));
1503
#ifndef KEXI_NO_TQUERY_TOTALS
1503
#ifndef KEXI_NO_QUERY_TOTALS
1504
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0));
1504
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0));
1505
#endif
1505
#endif
1506
			if (!sortingAllowed(fieldName, tableName)) {
1506
			if (!sortingAllowed(fieldName, tableName)) {
Lines 1533-1539 Link Here
1533
			if (!item->at(COLUMN_ID_COLUMN).toString().isEmpty())
1533
			if (!item->at(COLUMN_ID_COLUMN).toString().isEmpty())
1534
				d->data->updateRowEditBuffer(item, COLUMN_ID_COLUMN, TQVariant(), false/*!allowSignals*/);
1534
				d->data->updateRowEditBuffer(item, COLUMN_ID_COLUMN, TQVariant(), false/*!allowSignals*/);
1535
			d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible
1535
			d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible
1536
#ifndef KEXI_NO_TQUERY_TOTALS
1536
#ifndef KEXI_NO_QUERY_TOTALS
1537
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals
1537
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals
1538
#endif
1538
#endif
1539
			d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, TQVariant());//remove crit.
1539
			d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, TQVariant());//remove crit.
Lines 1560-1566 Link Here
1560
			saveOldValue = false;
1560
			saveOldValue = false;
1561
			createPropertySet( d->dataTable->dataAwareObject()->currentRow(),
1561
			createPropertySet( d->dataTable->dataAwareObject()->currentRow(),
1562
				item->at(COLUMN_ID_TABLE).toString(), item->at(COLUMN_ID_COLUMN).toString(), true );
1562
				item->at(COLUMN_ID_TABLE).toString(), item->at(COLUMN_ID_COLUMN).toString(), true );
1563
#ifndef KEXI_NO_TQUERY_TOTALS
1563
#ifndef KEXI_NO_QUERY_TOTALS
1564
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0));//totals
1564
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0));//totals
1565
#endif
1565
#endif
1566
			propertySetSwitched();
1566
			propertySetSwitched();
Lines 1568-1574 Link Here
1568
		KoProperty::Set &set = *propertySet();
1568
		KoProperty::Set &set = *propertySet();
1569
		set["visible"].setValue(newValue, saveOldValue);
1569
		set["visible"].setValue(newValue, saveOldValue);
1570
	}
1570
	}
1571
#ifndef KEXI_NO_TQUERY_TOTALS
1571
#ifndef KEXI_NO_QUERY_TOTALS
1572
	else if (colnum==COLUMN_ID_TOTALS) {
1572
	else if (colnum==COLUMN_ID_TOTALS) {
1573
		//TODO:
1573
		//TODO:
1574
		//unused yet
1574
		//unused yet
(-)koffice/kexi/plugins/queries/kexiquerydesignerguieditor.h (-2 / +2 lines)
Lines 18-25 Link Here
18
 * Boston, MA 02110-1301, USA.
18
 * Boston, MA 02110-1301, USA.
19
*/
19
*/
20
20
21
#ifndef KEXITQUERYDESIGNERGUIEDITOR_H
21
#ifndef KEXIQUERYDESIGNERGUIEDITOR_H
22
#define KEXITQUERYDESIGNERGUIEDITOR_H
22
#define KEXIQUERYDESIGNERGUIEDITOR_H
23
23
24
#include <tqguardedptr.h>
24
#include <tqguardedptr.h>
25
#include <tqsplitter.h>
25
#include <tqsplitter.h>
(-)koffice/kexi/plugins/queries/kexiquerydesignersql.h (-2 / +2 lines)
Lines 18-25 Link Here
18
 * Boston, MA 02110-1301, USA.
18
 * Boston, MA 02110-1301, USA.
19
*/
19
*/
20
20
21
#ifndef KEXITQUERYDESIGNERSQL_H
21
#ifndef KEXIQUERYDESIGNERSQL_H
22
#define KEXITQUERYDESIGNERSQL_H
22
#define KEXIQUERYDESIGNERSQL_H
23
23
24
#include <kexiviewbase.h>
24
#include <kexiviewbase.h>
25
#include "kexiquerypart.h"
25
#include "kexiquerypart.h"
(-)koffice/kexi/plugins/queries/kexiquerydesignersqlhistory.h (-2 / +2 lines)
Lines 18-25 Link Here
18
 * Boston, MA 02110-1301, USA.
18
 * Boston, MA 02110-1301, USA.
19
*/
19
*/
20
20
21
#ifndef KEXITQUERYDESIGNERSQLHISTORY_H
21
#ifndef KEXIQUERYDESIGNERSQLHISTORY_H
22
#define KEXITQUERYDESIGNERSQLHISTORY_H
22
#define KEXIQUERYDESIGNERSQLHISTORY_H
23
23
24
#include <tqscrollview.h>
24
#include <tqscrollview.h>
25
#include <tqdatetime.h>
25
#include <tqdatetime.h>
(-)koffice/kexi/plugins/queries/kexiquerypart.h (-2 / +2 lines)
Lines 18-25 Link Here
18
 * Boston, MA 02110-1301, USA.
18
 * Boston, MA 02110-1301, USA.
19
*/
19
*/
20
20
21
#ifndef KEXITQUERYPART_H
21
#ifndef KEXIQUERYPART_H
22
#define KEXITQUERYPART_H
22
#define KEXIQUERYPART_H
23
23
24
#include <tqmap.h>
24
#include <tqmap.h>
25
25
(-)koffice/kexi/plugins/queries/kexiqueryview.h (-2 / +2 lines)
Lines 18-25 Link Here
18
 * Boston, MA 02110-1301, USA.
18
 * Boston, MA 02110-1301, USA.
19
*/
19
*/
20
20
21
#ifndef KEXITQUERYVIEW_H
21
#ifndef KEXIQUERYVIEW_H
22
#define KEXITQUERYVIEW_H
22
#define KEXIQUERYVIEW_H
23
23
24
#include <kexidatatable.h>
24
#include <kexidatatable.h>
25
25
(-)koffice/kexi/widget/kexiquerydesignersqleditor.h (-2 / +2 lines)
Lines 19-26 Link Here
19
 * Boston, MA 02110-1301, USA.
19
 * Boston, MA 02110-1301, USA.
20
*/
20
*/
21
21
22
#ifndef KEXITQUERYDESIGNERSQLEDITOR_H
22
#ifndef KEXIQUERYDESIGNERSQLEDITOR_H
23
#define KEXITQUERYDESIGNERSQLEDITOR_H
23
#define KEXIQUERYDESIGNERSQLEDITOR_H
24
24
25
#include "kexieditor.h"
25
#include "kexieditor.h"
26
26
(-)koffice/kexi/widget/kexiqueryparameters.h (-2 / +2 lines)
Lines 17-24 Link Here
17
 * Boston, MA 02110-1301, USA.
17
 * Boston, MA 02110-1301, USA.
18
*/
18
*/
19
19
20
#ifndef KEXITQUERYPARAMETERS_H
20
#ifndef KEXIQUERYPARAMETERS_H
21
#define KEXITQUERYPARAMETERS_H
21
#define KEXIQUERYPARAMETERS_H
22
22
23
#include <kexidb/queryschema.h>
23
#include <kexidb/queryschema.h>
24
24
(-)koffice/kexi.new/3rdparty/kexisql/src/build.c (-5 / +5 lines)
Lines 526-532 Link Here
526
  /* Begin generating the code that will insert the table record into
526
  /* Begin generating the code that will insert the table record into
527
  ** the SQLITE_MASTER table.  Note in particular that we must go ahead
527
  ** the SQLITE_MASTER table.  Note in particular that we must go ahead
528
  ** and allocate the record number for the table entry now.  Before any
528
  ** and allocate the record number for the table entry now.  Before any
529
  ** PRIMARY KEY or UNITQUE keywords are parsed.  Those keywords will cause
529
  ** PRIMARY KEY or UNIQUE keywords are parsed.  Those keywords will cause
530
  ** indices to be created and the table record must come before the 
530
  ** indices to be created and the table record must come before the 
531
  ** indices.  Hence, the record number for the table must be allocated
531
  ** indices.  Hence, the record number for the table must be allocated
532
  ** now.
532
  ** now.
Lines 1461-1467 Link Here
1461
** Create a new index for an SQL table.  pIndex is the name of the index 
1461
** Create a new index for an SQL table.  pIndex is the name of the index 
1462
** and pTable is the name of the table that is to be indexed.  Both will 
1462
** and pTable is the name of the table that is to be indexed.  Both will 
1463
** be NULL for a primary key or an index that is created to satisfy a
1463
** be NULL for a primary key or an index that is created to satisfy a
1464
** UNITQUE constraint.  If pTable and pIndex are NULL, use pParse->pNewTable
1464
** UNIQUE constraint.  If pTable and pIndex are NULL, use pParse->pNewTable
1465
** as the table to be indexed.  pParse->pNewTable is a table that is
1465
** as the table to be indexed.  pParse->pNewTable is a table that is
1466
** currently being constructed by a CREATE TABLE statement.
1466
** currently being constructed by a CREATE TABLE statement.
1467
**
1467
**
Lines 1531-1537 Link Here
1531
  ** index, then we will continue to process this index.
1531
  ** index, then we will continue to process this index.
1532
  **
1532
  **
1533
  ** If pName==0 it means that we are
1533
  ** If pName==0 it means that we are
1534
  ** dealing with a primary key or UNITQUE constraint.  We have to invent our
1534
  ** dealing with a primary key or UNIQUE constraint.  We have to invent our
1535
  ** own name.
1535
  ** own name.
1536
  */
1536
  */
1537
  if( pName && !db->init.busy ){
1537
  if( pName && !db->init.busy ){
Lines 1673-1679 Link Here
1673
  ** we don't want to recreate it.
1673
  ** we don't want to recreate it.
1674
  **
1674
  **
1675
  ** If pTable==0 it means this index is generated as a primary key
1675
  ** If pTable==0 it means this index is generated as a primary key
1676
  ** or UNITQUE constraint of a CREATE TABLE statement.  Since the table
1676
  ** or UNIQUE constraint of a CREATE TABLE statement.  Since the table
1677
  ** has just been created, it contains no data and the index initialization
1677
  ** has just been created, it contains no data and the index initialization
1678
  ** step can be skipped.
1678
  ** step can be skipped.
1679
  */
1679
  */
Lines 1767-1773 Link Here
1767
    goto exit_drop_index;
1767
    goto exit_drop_index;
1768
  }
1768
  }
1769
  if( pIndex->autoIndex ){
1769
  if( pIndex->autoIndex ){
1770
    sqliteErrorMsg(pParse, "index associated with UNITQUE "
1770
    sqliteErrorMsg(pParse, "index associated with UNIQUE "
1771
      "or PRIMARY KEY constraint cannot be dropped", 0);
1771
      "or PRIMARY KEY constraint cannot be dropped", 0);
1772
    goto exit_drop_index;
1772
    goto exit_drop_index;
1773
  }
1773
  }
(-)koffice/kexi.new/3rdparty/kexisql/src/insert.c (-5 / +5 lines)
Lines 567-573 Link Here
567
** aIdxUsed!=0 and aIdxUsed[i]!=0.
567
** aIdxUsed!=0 and aIdxUsed[i]!=0.
568
**
568
**
569
** This routine also generates code to check constraints.  NOT NULL,
569
** This routine also generates code to check constraints.  NOT NULL,
570
** CHECK, and UNITQUE constraints are all checked.  If a constraint fails,
570
** CHECK, and UNIQUE constraints are all checked.  If a constraint fails,
571
** then the appropriate action is performed.  There are five possible
571
** then the appropriate action is performed.  There are five possible
572
** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
572
** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
573
**
573
**
Lines 595-601 Link Here
595
**                                value for that column.  If the default value
595
**                                value for that column.  If the default value
596
**                                is NULL, the action is the same as ABORT.
596
**                                is NULL, the action is the same as ABORT.
597
**
597
**
598
**  UNITQUE           REPLACE      The other row that conflicts with the row
598
**  UNIQUE           REPLACE      The other row that conflicts with the row
599
**                                being inserted is removed.
599
**                                being inserted is removed.
600
**
600
**
601
**  CHECK            REPLACE      Illegal.  The results in an exception.
601
**  CHECK            REPLACE      Illegal.  The results in an exception.
Lines 753-759 Link Here
753
    }
753
    }
754
  }
754
  }
755
755
756
  /* Test all UNITQUE constraints by creating entries for each UNITQUE
756
  /* Test all UNIQUE constraints by creating entries for each UNIQUE
757
  ** index and making sure that duplicate entries do not already exist.
757
  ** index and making sure that duplicate entries do not already exist.
758
  ** Add the new records to the indices as we go.
758
  ** Add the new records to the indices as we go.
759
  */
759
  */
Lines 777-783 Link Here
777
777
778
    /* Find out what action to take in case there is an indexing conflict */
778
    /* Find out what action to take in case there is an indexing conflict */
779
    onError = pIdx->onError;
779
    onError = pIdx->onError;
780
    if( onError==OE_None ) continue;  /* pIdx is not a UNITQUE index */
780
    if( onError==OE_None ) continue;  /* pIdx is not a UNIQUE index */
781
    if( overrideError!=OE_Default ){
781
    if( overrideError!=OE_Default ){
782
      onError = overrideError;
782
      onError = overrideError;
783
    }else if( pParse->db->onError!=OE_Default ){
783
    }else if( pParse->db->onError!=OE_Default ){
Lines 843-849 Link Here
843
      default: assert(0);
843
      default: assert(0);
844
    }
844
    }
845
    contAddr = sqliteVdbeCurrentAddr(v);
845
    contAddr = sqliteVdbeCurrentAddr(v);
846
#if NULL_DISTINCT_FOR_UNITQUE
846
#if NULL_DISTINCT_FOR_UNIQUE
847
    sqliteVdbeChangeP2(v, jumpInst1, contAddr);
847
    sqliteVdbeChangeP2(v, jumpInst1, contAddr);
848
#endif
848
#endif
849
    sqliteVdbeChangeP2(v, jumpInst2, contAddr);
849
    sqliteVdbeChangeP2(v, jumpInst2, contAddr);
(-)koffice/kexi.new/3rdparty/kexisql/src/main.c (-1 / +1 lines)
Lines 90-96 Link Here
90
        db->init.iDb = 0;
90
        db->init.iDb = 0;
91
      }else{
91
      }else{
92
        /* If the SQL column is blank it means this is an index that
92
        /* If the SQL column is blank it means this is an index that
93
        ** was created to be the PRIMARY KEY or to fulfill a UNITQUE
93
        ** was created to be the PRIMARY KEY or to fulfill a UNIQUE
94
        ** constraint for a CREATE TABLE.  The index should have already
94
        ** constraint for a CREATE TABLE.  The index should have already
95
        ** been created when we processed the CREATE TABLE.  All we have
95
        ** been created when we processed the CREATE TABLE.  All we have
96
        ** to do here is record the root page number for that index.
96
        ** to do here is record the root page number for that index.
(-)koffice/kexi.new/3rdparty/kexisql/src/parse.c (-8 / +8 lines)
Lines 711-717 Link Here
711
    0,  /*      FLOAT => nothing */
711
    0,  /*      FLOAT => nothing */
712
    0,  /*       NULL => nothing */
712
    0,  /*       NULL => nothing */
713
    0,  /*    PRIMARY => nothing */
713
    0,  /*    PRIMARY => nothing */
714
    0,  /*     UNITQUE => nothing */
714
    0,  /*     UNIQUE => nothing */
715
    0,  /*      CHECK => nothing */
715
    0,  /*      CHECK => nothing */
716
    0,  /* REFERENCES => nothing */
716
    0,  /* REFERENCES => nothing */
717
    0,  /*    COLLATE => nothing */
717
    0,  /*    COLLATE => nothing */
Lines 840-846 Link Here
840
  "STAR",          "SLASH",         "REM",           "CONCAT",      
840
  "STAR",          "SLASH",         "REM",           "CONCAT",      
841
  "UMINUS",        "UPLUS",         "BITNOT",        "STRING",      
841
  "UMINUS",        "UPLUS",         "BITNOT",        "STRING",      
842
  "JOIN_KW",       "INTEGER",       "CONSTRAINT",    "DEFAULT",     
842
  "JOIN_KW",       "INTEGER",       "CONSTRAINT",    "DEFAULT",     
843
  "FLOAT",         "NULL",          "PRIMARY",       "UNITQUE",      
843
  "FLOAT",         "NULL",          "PRIMARY",       "UNIQUE",      
844
  "CHECK",         "REFERENCES",    "COLLATE",       "ON",          
844
  "CHECK",         "REFERENCES",    "COLLATE",       "ON",          
845
  "DELETE",        "UPDATE",        "INSERT",        "SET",         
845
  "DELETE",        "UPDATE",        "INSERT",        "SET",         
846
  "DEFERRABLE",    "FOREIGN",       "DROP",          "UNION",       
846
  "DEFERRABLE",    "FOREIGN",       "DROP",          "UNION",       
Lines 935-941 Link Here
935
 /*  53 */ "ccons ::= NULL onconf",
935
 /*  53 */ "ccons ::= NULL onconf",
936
 /*  54 */ "ccons ::= NOT NULL onconf",
936
 /*  54 */ "ccons ::= NOT NULL onconf",
937
 /*  55 */ "ccons ::= PRIMARY KEY sortorder onconf",
937
 /*  55 */ "ccons ::= PRIMARY KEY sortorder onconf",
938
 /*  56 */ "ccons ::= UNITQUE onconf",
938
 /*  56 */ "ccons ::= UNIQUE onconf",
939
 /*  57 */ "ccons ::= CHECK LP expr RP onconf",
939
 /*  57 */ "ccons ::= CHECK LP expr RP onconf",
940
 /*  58 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
940
 /*  58 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
941
 /*  59 */ "ccons ::= defer_subclause",
941
 /*  59 */ "ccons ::= defer_subclause",
Lines 962-968 Link Here
962
 /*  80 */ "conslist ::= tcons",
962
 /*  80 */ "conslist ::= tcons",
963
 /*  81 */ "tcons ::= CONSTRAINT nm",
963
 /*  81 */ "tcons ::= CONSTRAINT nm",
964
 /*  82 */ "tcons ::= PRIMARY KEY LP idxlist RP onconf",
964
 /*  82 */ "tcons ::= PRIMARY KEY LP idxlist RP onconf",
965
 /*  83 */ "tcons ::= UNITQUE LP idxlist RP onconf",
965
 /*  83 */ "tcons ::= UNIQUE LP idxlist RP onconf",
966
 /*  84 */ "tcons ::= CHECK expr onconf",
966
 /*  84 */ "tcons ::= CHECK expr onconf",
967
 /*  85 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
967
 /*  85 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
968
 /*  86 */ "defer_subclause_opt ::=",
968
 /*  86 */ "defer_subclause_opt ::=",
Lines 1115-1121 Link Here
1115
 /* 233 */ "expritem ::= expr",
1115
 /* 233 */ "expritem ::= expr",
1116
 /* 234 */ "expritem ::=",
1116
 /* 234 */ "expritem ::=",
1117
 /* 235 */ "cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf",
1117
 /* 235 */ "cmd ::= CREATE uniqueflag INDEX nm ON nm dbnm LP idxlist RP onconf",
1118
 /* 236 */ "uniqueflag ::= UNITQUE",
1118
 /* 236 */ "uniqueflag ::= UNIQUE",
1119
 /* 237 */ "uniqueflag ::=",
1119
 /* 237 */ "uniqueflag ::=",
1120
 /* 238 */ "idxlist_opt ::=",
1120
 /* 238 */ "idxlist_opt ::=",
1121
 /* 239 */ "idxlist_opt ::= LP idxlist RP",
1121
 /* 239 */ "idxlist_opt ::= LP idxlist RP",
Lines 2183-2189 Link Here
2183
#line 191 "parse.y"
2183
#line 191 "parse.y"
2184
{sqliteCreateIndex(pParse,0,0,0,yymsp[0].minor.yy372,0,0);}
2184
{sqliteCreateIndex(pParse,0,0,0,yymsp[0].minor.yy372,0,0);}
2185
#line 2185 "parse.c"
2185
#line 2185 "parse.c"
2186
        /* No destructor defined for UNITQUE */
2186
        /* No destructor defined for UNIQUE */
2187
        break;
2187
        break;
2188
      case 57:
2188
      case 57:
2189
        /* No destructor defined for CHECK */
2189
        /* No destructor defined for CHECK */
Lines 2342-2348 Link Here
2342
#line 238 "parse.y"
2342
#line 238 "parse.y"
2343
{sqliteCreateIndex(pParse,0,0,yymsp[-2].minor.yy320,yymsp[0].minor.yy372,0,0);}
2343
{sqliteCreateIndex(pParse,0,0,yymsp[-2].minor.yy320,yymsp[0].minor.yy372,0,0);}
2344
#line 2344 "parse.c"
2344
#line 2344 "parse.c"
2345
        /* No destructor defined for UNITQUE */
2345
        /* No destructor defined for UNIQUE */
2346
        /* No destructor defined for LP */
2346
        /* No destructor defined for LP */
2347
        /* No destructor defined for RP */
2347
        /* No destructor defined for RP */
2348
        break;
2348
        break;
Lines 3428-3434 Link Here
3428
#line 740 "parse.y"
3428
#line 740 "parse.y"
3429
{ yygotominor.yy372 = OE_Abort; }
3429
{ yygotominor.yy372 = OE_Abort; }
3430
#line 3430 "parse.c"
3430
#line 3430 "parse.c"
3431
        /* No destructor defined for UNITQUE */
3431
        /* No destructor defined for UNIQUE */
3432
        break;
3432
        break;
3433
      case 237:
3433
      case 237:
3434
#line 741 "parse.y"
3434
#line 741 "parse.y"
(-)koffice/kexi.new/3rdparty/kexisql/src/parse.h (-1 / +1 lines)
Lines 92-98 Link Here
92
#define TK_FLOAT                          92
92
#define TK_FLOAT                          92
93
#define TK_NULL                           93
93
#define TK_NULL                           93
94
#define TK_PRIMARY                        94
94
#define TK_PRIMARY                        94
95
#define TK_UNITQUE                         95
95
#define TK_UNIQUE                         95
96
#define TK_CHECK                          96
96
#define TK_CHECK                          96
97
#define TK_REFERENCES                     97
97
#define TK_REFERENCES                     97
98
#define TK_COLLATE                        98
98
#define TK_COLLATE                        98
(-)koffice/kexi.new/3rdparty/kexisql/src/sqliteInt.h (-6 / +6 lines)
Lines 45-60 Link Here
45
/*
45
/*
46
** If the following macro is set to 1, then NULL values are considered
46
** If the following macro is set to 1, then NULL values are considered
47
** distinct when determining whether or not two entries are the same
47
** distinct when determining whether or not two entries are the same
48
** in a UNITQUE index.  This is the way PostgreSQL, Oracle, DB2, MySQL,
48
** in a UNIQUE index.  This is the way PostgreSQL, Oracle, DB2, MySQL,
49
** OCELOT, and Firebird all work.  The SQL92 spec explicitly says this
49
** OCELOT, and Firebird all work.  The SQL92 spec explicitly says this
50
** is the way things are suppose to work.
50
** is the way things are suppose to work.
51
**
51
**
52
** If the following macro is set to 0, the NULLs are indistinct for
52
** If the following macro is set to 0, the NULLs are indistinct for
53
** a UNITQUE index.  In this mode, you can only have a single NULL entry
53
** a UNIQUE index.  In this mode, you can only have a single NULL entry
54
** for a column declared UNITQUE.  This is the way Informix and SQL Server
54
** for a column declared UNIQUE.  This is the way Informix and SQL Server
55
** work.
55
** work.
56
*/
56
*/
57
#define NULL_DISTINCT_FOR_UNITQUE 1
57
#define NULL_DISTINCT_FOR_UNIQUE 1
58
58
59
/*
59
/*
60
** The maximum number of attached databases.  This must be at least 2
60
** The maximum number of attached databases.  This must be at least 2
Lines 563-569 Link Here
563
** occurs.  IGNORE means that the particular row that caused the constraint
563
** occurs.  IGNORE means that the particular row that caused the constraint
564
** error is not inserted or updated.  Processing continues and no error
564
** error is not inserted or updated.  Processing continues and no error
565
** is returned.  REPLACE means that preexisting database rows that caused
565
** is returned.  REPLACE means that preexisting database rows that caused
566
** a UNITQUE constraint violation are removed so that the new insert or
566
** a UNIQUE constraint violation are removed so that the new insert or
567
** update can proceed.  Processing continues and no error is reported.
567
** update can proceed.  Processing continues and no error is reported.
568
**
568
**
569
** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
569
** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
Lines 623-629 Link Here
623
  Table *pTable;   /* The SQL table being indexed */
623
  Table *pTable;   /* The SQL table being indexed */
624
  int tnum;        /* Page containing root of this index in database file */
624
  int tnum;        /* Page containing root of this index in database file */
625
  u8 onError;      /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
625
  u8 onError;      /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
626
  u8 autoIndex;    /* True if is automatically created (ex: by UNITQUE) */
626
  u8 autoIndex;    /* True if is automatically created (ex: by UNIQUE) */
627
  u8 iDb;          /* Index in sqlite.aDb[] of where this index is stored */
627
  u8 iDb;          /* Index in sqlite.aDb[] of where this index is stored */
628
  Index *pNext;    /* The next index associated with the same table */
628
  Index *pNext;    /* The next index associated with the same table */
629
};
629
};
(-)koffice/kexi.new/3rdparty/kexisql/src/tokenize.c (-1 / +1 lines)
Lines 130-136 Link Here
130
  { "TRANSACTION",       TK_TRANSACTION,  },
130
  { "TRANSACTION",       TK_TRANSACTION,  },
131
  { "TRIGGER",           TK_TRIGGER,      },
131
  { "TRIGGER",           TK_TRIGGER,      },
132
  { "UNION",             TK_UNION,        },
132
  { "UNION",             TK_UNION,        },
133
  { "UNITQUE",            TK_UNITQUE,       },
133
  { "UNIQUE",            TK_UNIQUE,       },
134
  { "UPDATE",            TK_UPDATE,       },
134
  { "UPDATE",            TK_UPDATE,       },
135
  { "USING",             TK_USING,        },
135
  { "USING",             TK_USING,        },
136
  { "VACUUM",            TK_VACUUM,       },
136
  { "VACUUM",            TK_VACUUM,       },
(-)koffice/kexi.new/3rdparty/kexisql/src/vdbe.c (-1 / +1 lines)
Lines 2741-2747 Link Here
2741
    /* The last four bytes of the key are different from R.  Convert the
2741
    /* The last four bytes of the key are different from R.  Convert the
2742
    ** last four bytes of the key into an integer and push it onto the
2742
    ** last four bytes of the key into an integer and push it onto the
2743
    ** stack.  (These bytes are the record number of an entry that
2743
    ** stack.  (These bytes are the record number of an entry that
2744
    ** violates a UNITQUE constraint.)
2744
    ** violates a UNIQUE constraint.)
2745
    */
2745
    */
2746
    pTos++;
2746
    pTos++;
2747
    pTos->i = v;
2747
    pTos->i = v;
(-)koffice/kexi.new/3rdparty/kexisql3/src/alter.c (-2 / +2 lines)
Lines 407-413 Link Here
407
    pDflt = 0;
407
    pDflt = 0;
408
  }
408
  }
409
409
410
  /* Check that the new column is not specified as PRIMARY KEY or UNITQUE.
410
  /* Check that the new column is not specified as PRIMARY KEY or UNIQUE.
411
  ** If there is a NOT NULL constraint, then the default value for the
411
  ** If there is a NOT NULL constraint, then the default value for the
412
  ** column must not be NULL.
412
  ** column must not be NULL.
413
  */
413
  */
Lines 416-422 Link Here
416
    return;
416
    return;
417
  }
417
  }
418
  if( pNew->pIndex ){
418
  if( pNew->pIndex ){
419
    sqlite3ErrorMsg(pParse, "Cannot add a UNITQUE column");
419
    sqlite3ErrorMsg(pParse, "Cannot add a UNIQUE column");
420
    return;
420
    return;
421
  }
421
  }
422
  if( pCol->notNull && !pDflt ){
422
  if( pCol->notNull && !pDflt ){
(-)koffice/kexi.new/3rdparty/kexisql3/src/btree.c (-3 / +3 lines)
Lines 3930-3942 Link Here
3930
  }
3930
  }
3931
  szCell = (int*)&apCell[nMaxCells];
3931
  szCell = (int*)&apCell[nMaxCells];
3932
  aCopy[0] = (u8*)&szCell[nMaxCells];
3932
  aCopy[0] = (u8*)&szCell[nMaxCells];
3933
  assert( ((aCopy[0] - (u8*)apCell) & 7)==0 ); /* 8-byte tqalignment required */
3933
  assert( ((aCopy[0] - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */
3934
  for(i=1; i<NB; i++){
3934
  for(i=1; i<NB; i++){
3935
    aCopy[i] = &aCopy[i-1][pBt->pageSize+ROUND8(sizeof(MemPage))];
3935
    aCopy[i] = &aCopy[i-1][pBt->pageSize+ROUND8(sizeof(MemPage))];
3936
    assert( ((aCopy[i] - (u8*)apCell) & 7)==0 ); /* 8-byte tqalignment required */
3936
    assert( ((aCopy[i] - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */
3937
  }
3937
  }
3938
  aSpace = &aCopy[NB-1][pBt->pageSize+ROUND8(sizeof(MemPage))];
3938
  aSpace = &aCopy[NB-1][pBt->pageSize+ROUND8(sizeof(MemPage))];
3939
  assert( ((aSpace - (u8*)apCell) & 7)==0 ); /* 8-byte tqalignment required */
3939
  assert( ((aSpace - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */
3940
#ifndef SQLITE_OMIT_AUTOVACUUM
3940
#ifndef SQLITE_OMIT_AUTOVACUUM
3941
  if( pBt->autoVacuum ){
3941
  if( pBt->autoVacuum ){
3942
    aFrom = &aSpace[5*pBt->pageSize];
3942
    aFrom = &aSpace[5*pBt->pageSize];
(-)koffice/kexi.new/3rdparty/kexisql3/src/build.c (-10 / +10 lines)
Lines 746-752 Link Here
746
  /* Begin generating the code that will insert the table record into
746
  /* Begin generating the code that will insert the table record into
747
  ** the SQLITE_MASTER table.  Note in particular that we must go ahead
747
  ** the SQLITE_MASTER table.  Note in particular that we must go ahead
748
  ** and allocate the record number for the table entry now.  Before any
748
  ** and allocate the record number for the table entry now.  Before any
749
  ** PRIMARY KEY or UNITQUE keywords are parsed.  Those keywords will cause
749
  ** PRIMARY KEY or UNIQUE keywords are parsed.  Those keywords will cause
750
  ** indices to be created and the table record must come before the 
750
  ** indices to be created and the table record must come before the 
751
  ** indices.  Hence, the record number for the table must be allocated
751
  ** indices.  Hence, the record number for the table must be allocated
752
  ** now.
752
  ** now.
Lines 2011-2017 Link Here
2011
** Create a new index for an SQL table.  pName1.pName2 is the name of the index 
2011
** Create a new index for an SQL table.  pName1.pName2 is the name of the index 
2012
** and pTblList is the name of the table that is to be indexed.  Both will 
2012
** and pTblList is the name of the table that is to be indexed.  Both will 
2013
** be NULL for a primary key or an index that is created to satisfy a
2013
** be NULL for a primary key or an index that is created to satisfy a
2014
** UNITQUE constraint.  If pTable and pIndex are NULL, use pParse->pNewTable
2014
** UNIQUE constraint.  If pTable and pIndex are NULL, use pParse->pNewTable
2015
** as the table to be indexed.  pParse->pNewTable is a table that is
2015
** as the table to be indexed.  pParse->pNewTable is a table that is
2016
** currently being constructed by a CREATE TABLE statement.
2016
** currently being constructed by a CREATE TABLE statement.
2017
**
2017
**
Lines 2104-2110 Link Here
2104
  ** index, then we will continue to process this index.
2104
  ** index, then we will continue to process this index.
2105
  **
2105
  **
2106
  ** If pName==0 it means that we are
2106
  ** If pName==0 it means that we are
2107
  ** dealing with a primary key or UNITQUE constraint.  We have to invent our
2107
  ** dealing with a primary key or UNIQUE constraint.  We have to invent our
2108
  ** own name.
2108
  ** own name.
2109
  */
2109
  */
2110
  if( pName ){
2110
  if( pName ){
Lines 2211-2222 Link Here
2211
2211
2212
  if( pTab==pParse->pNewTable ){
2212
  if( pTab==pParse->pNewTable ){
2213
    /* This routine has been called to create an automatic index as a
2213
    /* This routine has been called to create an automatic index as a
2214
    ** result of a PRIMARY KEY or UNITQUE clause on a column definition, or
2214
    ** result of a PRIMARY KEY or UNIQUE clause on a column definition, or
2215
    ** a PRIMARY KEY or UNITQUE clause following the column definitions.
2215
    ** a PRIMARY KEY or UNIQUE clause following the column definitions.
2216
    ** i.e. one of:
2216
    ** i.e. one of:
2217
    **
2217
    **
2218
    ** CREATE TABLE t(x PRIMARY KEY, y);
2218
    ** CREATE TABLE t(x PRIMARY KEY, y);
2219
    ** CREATE TABLE t(x, y, UNITQUE(x, y));
2219
    ** CREATE TABLE t(x, y, UNIQUE(x, y));
2220
    **
2220
    **
2221
    ** Either way, check to see if the table already has such an index. If
2221
    ** Either way, check to see if the table already has such an index. If
2222
    ** so, don't bother creating this one. This only applies to
2222
    ** so, don't bother creating this one. This only applies to
Lines 2285-2291 Link Here
2285
  ** we don't want to recreate it.
2285
  ** we don't want to recreate it.
2286
  **
2286
  **
2287
  ** If pTblName==0 it means this index is generated as a primary key
2287
  ** If pTblName==0 it means this index is generated as a primary key
2288
  ** or UNITQUE constraint of a CREATE TABLE statement.  Since the table
2288
  ** or UNIQUE constraint of a CREATE TABLE statement.  Since the table
2289
  ** has just been created, it contains no data and the index initialization
2289
  ** has just been created, it contains no data and the index initialization
2290
  ** step can be skipped.
2290
  ** step can be skipped.
2291
  */
2291
  */
Lines 2309-2319 Link Here
2309
    if( pStart && pEnd ){
2309
    if( pStart && pEnd ){
2310
      /* A named index with an explicit CREATE INDEX statement */
2310
      /* A named index with an explicit CREATE INDEX statement */
2311
      zStmt = sqlite3MPrintf("CREATE%s INDEX %.*s",
2311
      zStmt = sqlite3MPrintf("CREATE%s INDEX %.*s",
2312
        onError==OE_None ? "" : " UNITQUE",
2312
        onError==OE_None ? "" : " UNIQUE",
2313
        pEnd->z - pName->z + 1,
2313
        pEnd->z - pName->z + 1,
2314
        pName->z);
2314
        pName->z);
2315
    }else{
2315
    }else{
2316
      /* An automatic index created by a PRIMARY KEY or UNITQUE constraint */
2316
      /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */
2317
      /* zStmt = sqlite3MPrintf(""); */
2317
      /* zStmt = sqlite3MPrintf(""); */
2318
      zStmt = 0;
2318
      zStmt = 0;
2319
    }
2319
    }
Lines 2428-2434 Link Here
2428
    goto exit_drop_index;
2428
    goto exit_drop_index;
2429
  }
2429
  }
2430
  if( pIndex->autoIndex ){
2430
  if( pIndex->autoIndex ){
2431
    sqlite3ErrorMsg(pParse, "index associated with UNITQUE "
2431
    sqlite3ErrorMsg(pParse, "index associated with UNIQUE "
2432
      "or PRIMARY KEY constraint cannot be dropped", 0);
2432
      "or PRIMARY KEY constraint cannot be dropped", 0);
2433
    goto exit_drop_index;
2433
    goto exit_drop_index;
2434
  }
2434
  }
(-)koffice/kexi.new/3rdparty/kexisql3/src/insert.c (-5 / +5 lines)
Lines 746-752 Link Here
746
** aIdxUsed!=0 and aIdxUsed[i]!=0.
746
** aIdxUsed!=0 and aIdxUsed[i]!=0.
747
**
747
**
748
** This routine also generates code to check constraints.  NOT NULL,
748
** This routine also generates code to check constraints.  NOT NULL,
749
** CHECK, and UNITQUE constraints are all checked.  If a constraint fails,
749
** CHECK, and UNIQUE constraints are all checked.  If a constraint fails,
750
** then the appropriate action is performed.  There are five possible
750
** then the appropriate action is performed.  There are five possible
751
** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
751
** actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.
752
**
752
**
Lines 774-780 Link Here
774
**                                value for that column.  If the default value
774
**                                value for that column.  If the default value
775
**                                is NULL, the action is the same as ABORT.
775
**                                is NULL, the action is the same as ABORT.
776
**
776
**
777
**  UNITQUE           REPLACE      The other row that conflicts with the row
777
**  UNIQUE           REPLACE      The other row that conflicts with the row
778
**                                being inserted is removed.
778
**                                being inserted is removed.
779
**
779
**
780
**  CHECK            REPLACE      Illegal.  The results in an exception.
780
**  CHECK            REPLACE      Illegal.  The results in an exception.
Lines 927-933 Link Here
927
    }
927
    }
928
  }
928
  }
929
929
930
  /* Test all UNITQUE constraints by creating entries for each UNITQUE
930
  /* Test all UNIQUE constraints by creating entries for each UNIQUE
931
  ** index and making sure that duplicate entries do not already exist.
931
  ** index and making sure that duplicate entries do not already exist.
932
  ** Add the new records to the indices as we go.
932
  ** Add the new records to the indices as we go.
933
  */
933
  */
Lines 951-957 Link Here
951
951
952
    /* Find out what action to take in case there is an indexing conflict */
952
    /* Find out what action to take in case there is an indexing conflict */
953
    onError = pIdx->onError;
953
    onError = pIdx->onError;
954
    if( onError==OE_None ) continue;  /* pIdx is not a UNITQUE index */
954
    if( onError==OE_None ) continue;  /* pIdx is not a UNIQUE index */
955
    if( overrideError!=OE_Default ){
955
    if( overrideError!=OE_Default ){
956
      onError = overrideError;
956
      onError = overrideError;
957
    }else if( onError==OE_Default ){
957
    }else if( onError==OE_Default ){
Lines 1015-1021 Link Here
1015
        break;
1015
        break;
1016
      }
1016
      }
1017
    }
1017
    }
1018
#if NULL_DISTINCT_FOR_UNITQUE
1018
#if NULL_DISTINCT_FOR_UNIQUE
1019
    sqlite3VdbeJumpHere(v, jumpInst1);
1019
    sqlite3VdbeJumpHere(v, jumpInst1);
1020
#endif
1020
#endif
1021
    sqlite3VdbeJumpHere(v, jumpInst2);
1021
    sqlite3VdbeJumpHere(v, jumpInst2);
(-)koffice/kexi.new/3rdparty/kexisql3/src/keywordhash.h (-2 / +2 lines)
Lines 9-15 Link Here
9
    "CURRENT_DATECURRENT_TIMESTAMPLANDESCDETACHDISTINCTDROPRAGMATCH"
9
    "CURRENT_DATECURRENT_TIMESTAMPLANDESCDETACHDISTINCTDROPRAGMATCH"
10
    "FAILIMITFROMFULLGROUPDATEIMMEDIATEINSERTINSTEADINTOFFSETISNULL"
10
    "FAILIMITFROMFULLGROUPDATEIMMEDIATEINSERTINSTEADINTOFFSETISNULL"
11
    "JOINORDEREPLACEOUTERESTRICTPRIMARYTQUERYRIGHTROLLBACKROWHENUNION"
11
    "JOINORDEREPLACEOUTERESTRICTPRIMARYTQUERYRIGHTROLLBACKROWHENUNION"
12
    "UNITQUEUSINGVACUUMVALUESVIEWHERE";
12
    "UNIQUEUSINGVACUUMVALUESVIEWHERE";
13
  static const unsigned char aHash[127] = {
13
  static const unsigned char aHash[127] = {
14
      91,  80, 106,  90,   0,   4,   0,   0, 113,   0,  83,   0,   0,
14
      91,  80, 106,  90,   0,   4,   0,   0, 113,   0,  83,   0,   0,
15
      94,  44,  76,  92,   0, 105, 108,  96,   0,   0,  10,   0,   0,
15
      94,  44,  76,  92,   0, 105, 108,  96,   0,   0,  10,   0,   0,
Lines 77-83 Link Here
77
    TK_INSERT,     TK_INSTEAD,    TK_INTO,       TK_OF,         TK_OFFSET,     
77
    TK_INSERT,     TK_INSTEAD,    TK_INTO,       TK_OF,         TK_OFFSET,     
78
    TK_SET,        TK_ISNULL,     TK_JOIN,       TK_ORDER,      TK_REPLACE,    
78
    TK_SET,        TK_ISNULL,     TK_JOIN,       TK_ORDER,      TK_REPLACE,    
79
    TK_JOIN_KW,    TK_RESTRICT,   TK_PRIMARY,    TK_TQUERY,      TK_JOIN_KW,    
79
    TK_JOIN_KW,    TK_RESTRICT,   TK_PRIMARY,    TK_TQUERY,      TK_JOIN_KW,    
80
    TK_ROLLBACK,   TK_ROW,        TK_WHEN,       TK_UNION,      TK_UNITQUE,     
80
    TK_ROLLBACK,   TK_ROW,        TK_WHEN,       TK_UNION,      TK_UNIQUE,     
81
    TK_USING,      TK_VACUUM,     TK_VALUES,     TK_VIEW,       TK_WHERE,      
81
    TK_USING,      TK_VACUUM,     TK_VALUES,     TK_VIEW,       TK_WHERE,      
82
  };
82
  };
83
  int h, i;
83
  int h, i;
(-)koffice/kexi.new/3rdparty/kexisql3/src/parse.c (-5 / +5 lines)
Lines 770-776 Link Here
770
    0,  /*    DEFAULT => nothing */
770
    0,  /*    DEFAULT => nothing */
771
    0,  /*       NULL => nothing */
771
    0,  /*       NULL => nothing */
772
    0,  /*    PRIMARY => nothing */
772
    0,  /*    PRIMARY => nothing */
773
    0,  /*     UNITQUE => nothing */
773
    0,  /*     UNIQUE => nothing */
774
    0,  /*      CHECK => nothing */
774
    0,  /*      CHECK => nothing */
775
    0,  /* REFERENCES => nothing */
775
    0,  /* REFERENCES => nothing */
776
    0,  /*    COLLATE => nothing */
776
    0,  /*    COLLATE => nothing */
Lines 910-916 Link Here
910
  "STAR",          "SLASH",         "REM",           "CONCAT",      
910
  "STAR",          "SLASH",         "REM",           "CONCAT",      
911
  "UMINUS",        "UPLUS",         "BITNOT",        "STRING",      
911
  "UMINUS",        "UPLUS",         "BITNOT",        "STRING",      
912
  "JOIN_KW",       "CONSTRAINT",    "DEFAULT",       "NULL",        
912
  "JOIN_KW",       "CONSTRAINT",    "DEFAULT",       "NULL",        
913
  "PRIMARY",       "UNITQUE",        "CHECK",         "REFERENCES",  
913
  "PRIMARY",       "UNIQUE",        "CHECK",         "REFERENCES",  
914
  "COLLATE",       "AUTOINCR",      "ON",            "DELETE",      
914
  "COLLATE",       "AUTOINCR",      "ON",            "DELETE",      
915
  "UPDATE",        "INSERT",        "SET",           "DEFERRABLE",  
915
  "UPDATE",        "INSERT",        "SET",           "DEFERRABLE",  
916
  "FOREIGN",       "DROP",          "UNION",         "ALL",         
916
  "FOREIGN",       "DROP",          "UNION",         "ALL",         
Lines 1011-1017 Link Here
1011
 /*  54 */ "ccons ::= NULL onconf",
1011
 /*  54 */ "ccons ::= NULL onconf",
1012
 /*  55 */ "ccons ::= NOT NULL onconf",
1012
 /*  55 */ "ccons ::= NOT NULL onconf",
1013
 /*  56 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
1013
 /*  56 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc",
1014
 /*  57 */ "ccons ::= UNITQUE onconf",
1014
 /*  57 */ "ccons ::= UNIQUE onconf",
1015
 /*  58 */ "ccons ::= CHECK LP expr RP onconf",
1015
 /*  58 */ "ccons ::= CHECK LP expr RP onconf",
1016
 /*  59 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
1016
 /*  59 */ "ccons ::= REFERENCES nm idxlist_opt refargs",
1017
 /*  60 */ "ccons ::= defer_subclause",
1017
 /*  60 */ "ccons ::= defer_subclause",
Lines 1040-1046 Link Here
1040
 /*  83 */ "conslist ::= tcons",
1040
 /*  83 */ "conslist ::= tcons",
1041
 /*  84 */ "tcons ::= CONSTRAINT nm",
1041
 /*  84 */ "tcons ::= CONSTRAINT nm",
1042
 /*  85 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
1042
 /*  85 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf",
1043
 /*  86 */ "tcons ::= UNITQUE LP idxlist RP onconf",
1043
 /*  86 */ "tcons ::= UNIQUE LP idxlist RP onconf",
1044
 /*  87 */ "tcons ::= CHECK expr onconf",
1044
 /*  87 */ "tcons ::= CHECK expr onconf",
1045
 /*  88 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
1045
 /*  88 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt",
1046
 /*  89 */ "defer_subclause_opt ::=",
1046
 /*  89 */ "defer_subclause_opt ::=",
Lines 1199-1205 Link Here
1199
 /* 242 */ "expritem ::= expr",
1199
 /* 242 */ "expritem ::= expr",
1200
 /* 243 */ "expritem ::=",
1200
 /* 243 */ "expritem ::=",
1201
 /* 244 */ "cmd ::= CREATE uniqueflag INDEX nm dbnm ON nm LP idxlist RP onconf",
1201
 /* 244 */ "cmd ::= CREATE uniqueflag INDEX nm dbnm ON nm LP idxlist RP onconf",
1202
 /* 245 */ "uniqueflag ::= UNITQUE",
1202
 /* 245 */ "uniqueflag ::= UNIQUE",
1203
 /* 246 */ "uniqueflag ::=",
1203
 /* 246 */ "uniqueflag ::=",
1204
 /* 247 */ "idxlist_opt ::=",
1204
 /* 247 */ "idxlist_opt ::=",
1205
 /* 248 */ "idxlist_opt ::= LP idxlist RP",
1205
 /* 248 */ "idxlist_opt ::= LP idxlist RP",
(-)koffice/kexi.new/3rdparty/kexisql3/src/parse.h (-1 / +1 lines)
Lines 98-104 Link Here
98
#define TK_DEFAULT                        98
98
#define TK_DEFAULT                        98
99
#define TK_NULL                           99
99
#define TK_NULL                           99
100
#define TK_PRIMARY                        100
100
#define TK_PRIMARY                        100
101
#define TK_UNITQUE                         101
101
#define TK_UNIQUE                         101
102
#define TK_CHECK                          102
102
#define TK_CHECK                          102
103
#define TK_REFERENCES                     103
103
#define TK_REFERENCES                     103
104
#define TK_COLLATE                        104
104
#define TK_COLLATE                        104
(-)koffice/kexi.new/3rdparty/kexisql3/src/prepare.c (-1 / +1 lines)
Lines 77-83 Link Here
77
    }
77
    }
78
  }else{
78
  }else{
79
    /* If the SQL column is blank it means this is an index that
79
    /* If the SQL column is blank it means this is an index that
80
    ** was created to be the PRIMARY KEY or to fulfill a UNITQUE
80
    ** was created to be the PRIMARY KEY or to fulfill a UNIQUE
81
    ** constraint for a CREATE TABLE.  The index should have already
81
    ** constraint for a CREATE TABLE.  The index should have already
82
    ** been created when we processed the CREATE TABLE.  All we have
82
    ** been created when we processed the CREATE TABLE.  All we have
83
    ** to do here is record the root page number for that index.
83
    ** to do here is record the root page number for that index.
(-)koffice/kexi.new/3rdparty/kexisql3/src/sqliteInt.h (-6 / +6 lines)
Lines 104-119 Link Here
104
/*
104
/*
105
** If the following macro is set to 1, then NULL values are considered
105
** If the following macro is set to 1, then NULL values are considered
106
** distinct when determining whether or not two entries are the same
106
** distinct when determining whether or not two entries are the same
107
** in a UNITQUE index.  This is the way PostgreSQL, Oracle, DB2, MySQL,
107
** in a UNIQUE index.  This is the way PostgreSQL, Oracle, DB2, MySQL,
108
** OCELOT, and Firebird all work.  The SQL92 spec explicitly says this
108
** OCELOT, and Firebird all work.  The SQL92 spec explicitly says this
109
** is the way things are suppose to work.
109
** is the way things are suppose to work.
110
**
110
**
111
** If the following macro is set to 0, the NULLs are indistinct for
111
** If the following macro is set to 0, the NULLs are indistinct for
112
** a UNITQUE index.  In this mode, you can only have a single NULL entry
112
** a UNIQUE index.  In this mode, you can only have a single NULL entry
113
** for a column declared UNITQUE.  This is the way Informix and SQL Server
113
** for a column declared UNIQUE.  This is the way Informix and SQL Server
114
** work.
114
** work.
115
*/
115
*/
116
#define NULL_DISTINCT_FOR_UNITQUE 1
116
#define NULL_DISTINCT_FOR_UNIQUE 1
117
117
118
/*
118
/*
119
** The maximum number of attached databases.  This must be at least 2
119
** The maximum number of attached databases.  This must be at least 2
Lines 700-706 Link Here
700
** occurs.  IGNORE means that the particular row that caused the constraint
700
** occurs.  IGNORE means that the particular row that caused the constraint
701
** error is not inserted or updated.  Processing continues and no error
701
** error is not inserted or updated.  Processing continues and no error
702
** is returned.  REPLACE means that preexisting database rows that caused
702
** is returned.  REPLACE means that preexisting database rows that caused
703
** a UNITQUE constraint violation are removed so that the new insert or
703
** a UNIQUE constraint violation are removed so that the new insert or
704
** update can proceed.  Processing continues and no error is reported.
704
** update can proceed.  Processing continues and no error is reported.
705
**
705
**
706
** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
706
** RESTRICT, SETNULL, and CASCADE actions apply only to foreign keys.
Lines 779-785 Link Here
779
  Table *pTable;   /* The SQL table being indexed */
779
  Table *pTable;   /* The SQL table being indexed */
780
  int tnum;        /* Page containing root of this index in database file */
780
  int tnum;        /* Page containing root of this index in database file */
781
  u8 onError;      /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
781
  u8 onError;      /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
782
  u8 autoIndex;    /* True if is automatically created (ex: by UNITQUE) */
782
  u8 autoIndex;    /* True if is automatically created (ex: by UNIQUE) */
783
  u8 iDb;          /* Index in sqlite.aDb[] of where this index is stored */
783
  u8 iDb;          /* Index in sqlite.aDb[] of where this index is stored */
784
  char *zColAff;   /* String defining the affinity of each column */
784
  char *zColAff;   /* String defining the affinity of each column */
785
  Index *pNext;    /* The next index associated with the same table */
785
  Index *pNext;    /* The next index associated with the same table */
(-)koffice/kexi.new/3rdparty/kexisql3/src/vacuum.c (-2 / +2 lines)
Lines 212-219 Link Here
212
      "  FROM sqlite_master WHERE sql LIKE 'CREATE INDEX %' ", 0);
212
      "  FROM sqlite_master WHERE sql LIKE 'CREATE INDEX %' ", 0);
213
  if( rc!=SQLITE_OK ) goto end_of_vacuum;
213
  if( rc!=SQLITE_OK ) goto end_of_vacuum;
214
  rc = execExecSql(db, 
214
  rc = execExecSql(db, 
215
      "SELECT 'CREATE UNITQUE INDEX vacuum_db.' || substr(sql,21,100000000) "
215
      "SELECT 'CREATE UNIQUE INDEX vacuum_db.' || substr(sql,21,100000000) "
216
      "  FROM sqlite_master WHERE sql LIKE 'CREATE UNITQUE INDEX %'", 0);
216
      "  FROM sqlite_master WHERE sql LIKE 'CREATE UNIQUE INDEX %'", 0);
217
  if( rc!=SQLITE_OK ) goto end_of_vacuum;
217
  if( rc!=SQLITE_OK ) goto end_of_vacuum;
218
  rc = execExecSql(db, 
218
  rc = execExecSql(db, 
219
      "SELECT 'CREATE VIEW vacuum_db.' || substr(sql,13,100000000) "
219
      "SELECT 'CREATE VIEW vacuum_db.' || substr(sql,13,100000000) "
(-)koffice/kexi.new/3rdparty/kexisql3/src/vdbe.c (-1 / +1 lines)
Lines 2956-2962 Link Here
2956
    }
2956
    }
2957
2957
2958
    /* The final varint of the key is different from R.  Push it onto
2958
    /* The final varint of the key is different from R.  Push it onto
2959
    ** the stack.  (The record number of an entry that violates a UNITQUE
2959
    ** the stack.  (The record number of an entry that violates a UNIQUE
2960
    ** constraint.)
2960
    ** constraint.)
2961
    */
2961
    */
2962
    pTos++;
2962
    pTos++;
(-)koffice/kexi.new/3rdparty/kexisql3/src/where.c (-5 / +5 lines)
Lines 170-176 Link Here
170
#define WHERE_IDX_ONLY       0x0800   /* Use index only - omit table */
170
#define WHERE_IDX_ONLY       0x0800   /* Use index only - omit table */
171
#define WHERE_ORDERBY        0x1000   /* Output will appear in correct order */
171
#define WHERE_ORDERBY        0x1000   /* Output will appear in correct order */
172
#define WHERE_REVERSE        0x2000   /* Scan in reverse order */
172
#define WHERE_REVERSE        0x2000   /* Scan in reverse order */
173
#define WHERE_UNITQUE         0x4000   /* Selects no more than one row */
173
#define WHERE_UNIQUE         0x4000   /* Selects no more than one row */
174
174
175
/*
175
/*
176
** Initialize a preallocated WhereClause structure.
176
** Initialize a preallocated WhereClause structure.
Lines 747-753 Link Here
747
** clause and the match can still be a success.
747
** clause and the match can still be a success.
748
**
748
**
749
** All terms of the ORDER BY that match against the index must be either
749
** All terms of the ORDER BY that match against the index must be either
750
** ASC or DESC.  (Terms of the ORDER BY clause past the end of a UNITQUE
750
** ASC or DESC.  (Terms of the ORDER BY clause past the end of a UNIQUE
751
** index do not need to satisfy this constraint.)  The *pbRev value is
751
** index do not need to satisfy this constraint.)  The *pbRev value is
752
** set to 1 if the ORDER BY clause is all DESC and it is set to 0 if
752
** set to 1 if the ORDER BY clause is all DESC and it is set to 0 if
753
** the ORDER BY clause is all ASC.
753
** the ORDER BY clause is all ASC.
Lines 915-921 Link Here
915
    if( pTerm->operator & WO_EQ ){
915
    if( pTerm->operator & WO_EQ ){
916
      /* Rowid== is always the best pick.  Look no further.  Because only
916
      /* Rowid== is always the best pick.  Look no further.  Because only
917
      ** a single row is generated, output is always in sorted order */
917
      ** a single row is generated, output is always in sorted order */
918
      *pFlags = WHERE_ROWID_EQ | WHERE_UNITQUE;
918
      *pFlags = WHERE_ROWID_EQ | WHERE_UNIQUE;
919
      *pnEq = 1;
919
      *pnEq = 1;
920
      TRACE(("... best is rowid\n"));
920
      TRACE(("... best is rowid\n"));
921
      return 0.0;
921
      return 0.0;
Lines 1007-1013 Link Here
1007
    nEq = i;
1007
    nEq = i;
1008
    if( pProbe->onError!=OE_None && (flags & WHERE_COLUMN_IN)==0
1008
    if( pProbe->onError!=OE_None && (flags & WHERE_COLUMN_IN)==0
1009
         && nEq==pProbe->nColumn ){
1009
         && nEq==pProbe->nColumn ){
1010
      flags |= WHERE_UNITQUE;
1010
      flags |= WHERE_UNIQUE;
1011
    }
1011
    }
1012
    TRACE(("...... nEq=%d inMult=%.9g cost=%.9g\n", nEq, inMultiplier, cost));
1012
    TRACE(("...... nEq=%d inMult=%.9g cost=%.9g\n", nEq, inMultiplier, cost));
1013
1013
Lines 1514-1520 Link Here
1514
  /* If the total query only selects a single row, then the ORDER BY
1514
  /* If the total query only selects a single row, then the ORDER BY
1515
  ** clause is irrelevant.
1515
  ** clause is irrelevant.
1516
  */
1516
  */
1517
  if( (andFlags & WHERE_UNITQUE)!=0 && ppOrderBy ){
1517
  if( (andFlags & WHERE_UNIQUE)!=0 && ppOrderBy ){
1518
    *ppOrderBy = 0;
1518
    *ppOrderBy = 0;
1519
  }
1519
  }
1520
1520
(-)koffice/kexi.new/kexidb/connection.cpp (-6 / +6 lines)
Lines 671-677 Link Here
671
671
672
bool Connection::useTemporaryDatabaseIfNeeded(TQString &tmpdbName)
672
bool Connection::useTemporaryDatabaseIfNeeded(TQString &tmpdbName)
673
{
673
{
674
	if (!m_driver->isFileDriver() && m_driver->beh->USING_DATABASE_RETQUIRED_TO_CONNECT
674
	if (!m_driver->isFileDriver() && m_driver->beh->USING_DATABASE_REQUIRED_TO_CONNECT
675
	 && !isDatabaseUsed()) {
675
	 && !isDatabaseUsed()) {
676
		//we have no db used, but it is required by engine to have used any!
676
		//we have no db used, but it is required by engine to have used any!
677
		tmpdbName = anyAvailableDatabaseName();
677
		tmpdbName = anyAvailableDatabaseName();
Lines 884-891 Link Here
884
			sql += ", ";
884
			sql += ", ";
885
		TQString v = escapeIdentifier(field->name()) + " ";
885
		TQString v = escapeIdentifier(field->name()) + " ";
886
		const bool autoinc = field->isAutoIncrement();
886
		const bool autoinc = field->isAutoIncrement();
887
		const bool pk = field->isPrimaryKey() || (autoinc && m_driver->beh->AUTO_INCREMENT_RETQUIRES_PK);
887
		const bool pk = field->isPrimaryKey() || (autoinc && m_driver->beh->AUTO_INCREMENT_REQUIRES_PK);
888
//TODO: warning: ^^^^^ this allows only one autonumber per table when AUTO_INCREMENT_RETQUIRES_PK==true!
888
//TODO: warning: ^^^^^ this allows only one autonumber per table when AUTO_INCREMENT_REQUIRES_PK==true!
889
		if (autoinc && m_driver->beh->SPECIAL_AUTO_INCREMENT_DEF) {
889
		if (autoinc && m_driver->beh->SPECIAL_AUTO_INCREMENT_DEF) {
890
			if (pk)
890
			if (pk)
891
				v += m_driver->beh->AUTO_INCREMENT_TYPE + " " + m_driver->beh->AUTO_INCREMENT_PK_FIELD_OPTION;
891
				v += m_driver->beh->AUTO_INCREMENT_TYPE + " " + m_driver->beh->AUTO_INCREMENT_PK_FIELD_OPTION;
Lines 918-924 Link Here
918
				if (pk)
918
				if (pk)
919
					v += " PRIMARY KEY";
919
					v += " PRIMARY KEY";
920
			if (!pk && field->isUniqueKey())
920
			if (!pk && field->isUniqueKey())
921
				v += " UNITQUE";
921
				v += " UNIQUE";
922
///@todo IS this ok for all engines?: if (!autoinc && !field->isPrimaryKey() && field->isNotNull())
922
///@todo IS this ok for all engines?: if (!autoinc && !field->isPrimaryKey() && field->isNotNull())
923
			if (!autoinc && !pk && field->isNotNull())
923
			if (!autoinc && !pk && field->isNotNull())
924
				v += " NOT NULL"; //only add not null option if no autocommit is set
924
				v += " NOT NULL"; //only add not null option if no autocommit is set
Lines 2481-2487 Link Here
2481
{
2481
{
2482
	KexiDB::Cursor *cursor;
2482
	KexiDB::Cursor *cursor;
2483
	//optimization
2483
	//optimization
2484
	if (m_driver->beh->SELECT_1_SUBTQUERY_SUPPORTED) {
2484
	if (m_driver->beh->SELECT_1_SUBQUERY_SUPPORTED) {
2485
		//this is at least for sqlite
2485
		//this is at least for sqlite
2486
		if (addLimitTo1 && sql.left(6).upper() == "SELECT")
2486
		if (addLimitTo1 && sql.left(6).upper() == "SELECT")
2487
			m_sql = TQString("SELECT 1 FROM (") + sql + ") LIMIT 1"; // is this safe?;
2487
			m_sql = TQString("SELECT 1 FROM (") + sql + ") LIMIT 1"; // is this safe?;
Lines 3279-3285 Link Here
3279
	if (b.isEmpty()) {
3279
	if (b.isEmpty()) {
3280
		// empty row inserting requested:
3280
		// empty row inserting requested:
3281
		if (!getROWID && !pkey) {
3281
		if (!getROWID && !pkey) {
3282
			KexiDBWarn << "MASTER TABLE's PKEY RETQUIRED FOR INSERTING EMPTY ROWS: INSERT CANCELLED" << endl;
3282
			KexiDBWarn << "MASTER TABLE's PKEY REQUIRED FOR INSERTING EMPTY ROWS: INSERT CANCELLED" << endl;
3283
			setError(ERR_INSERT_NO_MASTER_TABLES_PKEY,
3283
			setError(ERR_INSERT_NO_MASTER_TABLES_PKEY,
3284
				i18n("Could not insert row because master table has no primary key defined."));
3284
				i18n("Could not insert row because master table has no primary key defined."));
3285
			return false;
3285
			return false;
(-)koffice/kexi.new/kexidb/cursor.cpp (-1 / +1 lines)
Lines 166-172 Link Here
166
166
167
//luci:	WHAT_EXACTLY_SHOULD_THAT_BE?
167
//luci:	WHAT_EXACTLY_SHOULD_THAT_BE?
168
//	if (!m_readAhead) // jowenn: to ensure before first state, without cluttering implementation code
168
//	if (!m_readAhead) // jowenn: to ensure before first state, without cluttering implementation code
169
	if (m_conn->driver()->beh->_1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY) {
169
	if (m_conn->driver()->beh->_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY) {
170
//		KexiDBDbg << "READ AHEAD:" << endl;
170
//		KexiDBDbg << "READ AHEAD:" << endl;
171
		m_readAhead = getNextRecord(); //true if any record in this query
171
		m_readAhead = getNextRecord(); //true if any record in this query
172
//		KexiDBDbg << "READ AHEAD = " << m_readAhead << endl;
172
//		KexiDBDbg << "READ AHEAD = " << m_readAhead << endl;
(-)koffice/kexi.new/kexidb/driver.cpp (-6 / +6 lines)
Lines 49-60 Link Here
49
	, AUTO_INCREMENT_FIELD_OPTION("AUTO_INCREMENT")
49
	, AUTO_INCREMENT_FIELD_OPTION("AUTO_INCREMENT")
50
	, AUTO_INCREMENT_PK_FIELD_OPTION("AUTO_INCREMENT PRIMARY KEY")
50
	, AUTO_INCREMENT_PK_FIELD_OPTION("AUTO_INCREMENT PRIMARY KEY")
51
	, SPECIAL_AUTO_INCREMENT_DEF(false)
51
	, SPECIAL_AUTO_INCREMENT_DEF(false)
52
	, AUTO_INCREMENT_RETQUIRES_PK(false)
52
	, AUTO_INCREMENT_REQUIRES_PK(false)
53
	, ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE(false)
53
	, ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE(false)
54
	, TQUOTATION_MARKS_FOR_IDENTIFIER('"')
54
	, QUOTATION_MARKS_FOR_IDENTIFIER('"')
55
	, USING_DATABASE_RETQUIRED_TO_CONNECT(true)
55
	, USING_DATABASE_REQUIRED_TO_CONNECT(true)
56
	, _1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY(false)
56
	, _1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY(false)
57
	, SELECT_1_SUBTQUERY_SUPPORTED(false)
57
	, SELECT_1_SUBQUERY_SUPPORTED(false)
58
	, SQL_KEYWORDS(0)
58
	, SQL_KEYWORDS(0)
59
{
59
{
60
}
60
}
Lines 350-356 Link Here
350
		return quote + TQCString(str).replace( quote, "\"\"" ) + quote;
350
		return quote + TQCString(str).replace( quote, "\"\"" ) + quote;
351
	}
351
	}
352
	else if (needOuterQuotes) {
352
	else if (needOuterQuotes) {
353
		const char quote = beh->TQUOTATION_MARKS_FOR_IDENTIFIER.latin1();
353
		const char quote = beh->QUOTATION_MARKS_FOR_IDENTIFIER.latin1();
354
		return quote + drv_escapeIdentifier(str) + quote;
354
		return quote + drv_escapeIdentifier(str) + quote;
355
	} else {
355
	} else {
356
		return drv_escapeIdentifier(str);
356
		return drv_escapeIdentifier(str);
(-)koffice/kexi.new/kexidb/driver.h (-1 / +1 lines)
Lines 318-324 Link Here
318
		 Implement escaping for any character like " or ' as your 
318
		 Implement escaping for any character like " or ' as your 
319
		 database engine requires. Do not append or prepend any quotation 
319
		 database engine requires. Do not append or prepend any quotation 
320
		 marks characters - it is automatically done by escapeIdentifier() using
320
		 marks characters - it is automatically done by escapeIdentifier() using
321
		 DriverBehaviour::TQUOTATION_MARKS_FOR_IDENTIFIER.
321
		 DriverBehaviour::QUOTATION_MARKS_FOR_IDENTIFIER.
322
		*/
322
		*/
323
		virtual TQString drv_escapeIdentifier( const TQString& str ) const = 0;
323
		virtual TQString drv_escapeIdentifier( const TQString& str ) const = 0;
324
		
324
		
(-)koffice/kexi.new/kexidb/driver_p.h (-5 / +5 lines)
Lines 72-78 Link Here
72
72
73
	/*! True if autoincrement requires field to be declared as primary key.
73
	/*! True if autoincrement requires field to be declared as primary key.
74
	 This is true for SQLite. False by default. */
74
	 This is true for SQLite. False by default. */
75
	bool AUTO_INCREMENT_RETQUIRES_PK : 1;
75
	bool AUTO_INCREMENT_REQUIRES_PK : 1;
76
76
77
	/*! Name of a field (or built-in function) with autoincremented unique value,
77
	/*! Name of a field (or built-in function) with autoincremented unique value,
78
	 typically returned by Connection::drv_lastInsertRowID().
78
	 typically returned by Connection::drv_lastInsertRowID().
Lines 114-120 Link Here
114
	/*! Quotation marks used for escaping identifier (see Driver::escapeIdentifier()).
114
	/*! Quotation marks used for escaping identifier (see Driver::escapeIdentifier()).
115
	 Default value is '"'. Change it for your driver.
115
	 Default value is '"'. Change it for your driver.
116
	*/
116
	*/
117
	TQChar TQUOTATION_MARKS_FOR_IDENTIFIER;
117
	TQChar QUOTATION_MARKS_FOR_IDENTIFIER;
118
	
118
	
119
	/*! True if using database is requied to perform real connection.
119
	/*! True if using database is requied to perform real connection.
120
	 This is true for may engines, e.g. for PostgreSQL, where connections 
120
	 This is true for may engines, e.g. for PostgreSQL, where connections 
Lines 122-137 Link Here
122
	 This flag is unused for file-based db drivers,
122
	 This flag is unused for file-based db drivers,
123
	 by default set to true and used for all other db drivers.
123
	 by default set to true and used for all other db drivers.
124
	*/
124
	*/
125
	bool USING_DATABASE_RETQUIRED_TO_CONNECT : 1;
125
	bool USING_DATABASE_REQUIRED_TO_CONNECT : 1;
126
126
127
	/*! True if before we know whether the fetched result of executed query
127
	/*! True if before we know whether the fetched result of executed query
128
	 is empty or not, we need to fetch first record. Particularly, it's true for SQLite.
128
	 is empty or not, we need to fetch first record. Particularly, it's true for SQLite.
129
	 The flag is used in Cursor::open(). By default this flag is false. */
129
	 The flag is used in Cursor::open(). By default this flag is false. */
130
	bool _1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY : 1;
130
	bool _1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY : 1;
131
131
132
	/*! True if "SELECT 1 from (subquery)" is supported. False by default.
132
	/*! True if "SELECT 1 from (subquery)" is supported. False by default.
133
	 Used in Connection::resultExists() for optimization. It's set to true for SQLite driver. */
133
	 Used in Connection::resultExists() for optimization. It's set to true for SQLite driver. */
134
	bool SELECT_1_SUBTQUERY_SUPPORTED : 1;
134
	bool SELECT_1_SUBQUERY_SUPPORTED : 1;
135
135
136
	/*! Keywords that need to be escaped for the driver.  Set this before calling
136
	/*! Keywords that need to be escaped for the driver.  Set this before calling
137
	    Driver::initSQLKeywords. */
137
	    Driver::initSQLKeywords. */
(-)koffice/kexi.new/kexidb/drivers/mySQL/mysqldriver.cpp (-3 / +3 lines)
Lines 63-71 Link Here
63
63
64
	beh->ROW_ID_FIELD_NAME="LAST_INSERT_ID()";
64
	beh->ROW_ID_FIELD_NAME="LAST_INSERT_ID()";
65
	beh->ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE=true;
65
	beh->ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE=true;
66
	beh->_1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=false;
66
	beh->_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=false;
67
	beh->USING_DATABASE_RETQUIRED_TO_CONNECT=false;
67
	beh->USING_DATABASE_REQUIRED_TO_CONNECT=false;
68
	beh->TQUOTATION_MARKS_FOR_IDENTIFIER='`';
68
	beh->QUOTATION_MARKS_FOR_IDENTIFIER='`';
69
	beh->SQL_KEYWORDS = keywords;
69
	beh->SQL_KEYWORDS = keywords;
70
	initSQLKeywords(331);
70
	initSQLKeywords(331);
71
	
71
	
(-)koffice/kexi.new/kexidb/drivers/pqxx/pqxxcursor.h (-2 / +2 lines)
Lines 17-24 Link Here
17
 * Boston, MA 02110-1301, USA.
17
 * Boston, MA 02110-1301, USA.
18
*/
18
*/
19
19
20
#ifndef KEXIDB_CURSOR_PTQXX_H
20
#ifndef KEXIDB_CURSOR_PQXX_H
21
#define KEXIDB_CURSOR_PTQXX_H
21
#define KEXIDB_CURSOR_PQXX_H
22
22
23
#include <kexidb/cursor.h>
23
#include <kexidb/cursor.h>
24
#include <kexidb/connection.h>
24
#include <kexidb/connection.h>
(-)koffice/kexi.new/kexidb/drivers/pqxx/pqxxdriver.cpp (-1 / +1 lines)
Lines 47-53 Link Here
47
	beh->AUTO_INCREMENT_FIELD_OPTION = "";
47
	beh->AUTO_INCREMENT_FIELD_OPTION = "";
48
	beh->AUTO_INCREMENT_PK_FIELD_OPTION = "PRIMARY KEY";
48
	beh->AUTO_INCREMENT_PK_FIELD_OPTION = "PRIMARY KEY";
49
	beh->ALWAYS_AVAILABLE_DATABASE_NAME = "template1";
49
	beh->ALWAYS_AVAILABLE_DATABASE_NAME = "template1";
50
	beh->TQUOTATION_MARKS_FOR_IDENTIFIER = '"';
50
	beh->QUOTATION_MARKS_FOR_IDENTIFIER = '"';
51
	beh->SQL_KEYWORDS = keywords;
51
	beh->SQL_KEYWORDS = keywords;
52
	initSQLKeywords(233);
52
	initSQLKeywords(233);
53
53
(-)koffice/kexi.new/kexidb/drivers/sqlite/sqlitedriver.cpp (-4 / +4 lines)
Lines 66-76 Link Here
66
	beh->AUTO_INCREMENT_FIELD_OPTION = ""; //not available
66
	beh->AUTO_INCREMENT_FIELD_OPTION = ""; //not available
67
	beh->AUTO_INCREMENT_TYPE = "INTEGER";
67
	beh->AUTO_INCREMENT_TYPE = "INTEGER";
68
	beh->AUTO_INCREMENT_PK_FIELD_OPTION = "PRIMARY KEY";
68
	beh->AUTO_INCREMENT_PK_FIELD_OPTION = "PRIMARY KEY";
69
	beh->AUTO_INCREMENT_RETQUIRES_PK = true;
69
	beh->AUTO_INCREMENT_REQUIRES_PK = true;
70
	beh->ROW_ID_FIELD_NAME = "OID";
70
	beh->ROW_ID_FIELD_NAME = "OID";
71
	beh->_1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=true;
71
	beh->_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=true;
72
	beh->TQUOTATION_MARKS_FOR_IDENTIFIER='"';
72
	beh->QUOTATION_MARKS_FOR_IDENTIFIER='"';
73
	beh->SELECT_1_SUBTQUERY_SUPPORTED = true;
73
	beh->SELECT_1_SUBQUERY_SUPPORTED = true;
74
	beh->SQL_KEYWORDS = keywords;
74
	beh->SQL_KEYWORDS = keywords;
75
	initSQLKeywords(29);
75
	initSQLKeywords(29);
76
76
(-)koffice/kexi.new/kexidb/expression.cpp (-1 / +1 lines)
Lines 568-574 Link Here
568
568
569
//=========================================
569
//=========================================
570
QueryParameterExpr::QueryParameterExpr(const TQString& message)
570
QueryParameterExpr::QueryParameterExpr(const TQString& message)
571
: ConstExpr( TQUERY_PARAMETER, message )
571
: ConstExpr( QUERY_PARAMETER, message )
572
, m_type(Field::Text)
572
, m_type(Field::Text)
573
{
573
{
574
	m_cl = KexiDBExpr_QueryParameter;
574
	m_cl = KexiDBExpr_QueryParameter;
(-)koffice/kexi.new/kexidb/field.cpp (-1 / +1 lines)
Lines 598-604 Link Here
598
	if (m_constraints & Field::AutoInc)
598
	if (m_constraints & Field::AutoInc)
599
		dbg += " AUTOINC";
599
		dbg += " AUTOINC";
600
	if (m_constraints & Field::Unique)
600
	if (m_constraints & Field::Unique)
601
		dbg += " UNITQUE";
601
		dbg += " UNIQUE";
602
	if (m_constraints & Field::PrimaryKey)
602
	if (m_constraints & Field::PrimaryKey)
603
		dbg += " PKEY";
603
		dbg += " PKEY";
604
	if (m_constraints & Field::ForeignKey)
604
	if (m_constraints & Field::ForeignKey)
(-)koffice/kexi.new/kexidb/indexschema.cpp (-1 / +1 lines)
Lines 157-163 Link Here
157
		+ (m_isForeignKey ? "FOREIGN KEY " : "")
157
		+ (m_isForeignKey ? "FOREIGN KEY " : "")
158
		+ (m_isAutoGenerated ? "AUTOGENERATED " : "")
158
		+ (m_isAutoGenerated ? "AUTOGENERATED " : "")
159
		+ (m_primary ? "PRIMARY " : "")
159
		+ (m_primary ? "PRIMARY " : "")
160
		+ ((!m_primary) && m_unique ? "UNITQUE " : "")
160
		+ ((!m_primary) && m_unique ? "UNIQUE " : "")
161
		+ FieldList::debugString();
161
		+ FieldList::debugString();
162
}
162
}
163
163
(-)koffice/kexi.new/kexidb/indexschema.h (-5 / +5 lines)
Lines 118-124 Link Here
118
			Auto-generated index is one-field index
118
			Auto-generated index is one-field index
119
			that was automatically generated 
119
			that was automatically generated 
120
			for CREATE TABLE statement when the field has 
120
			for CREATE TABLE statement when the field has 
121
			UNITQUE or PRIMARY KEY constraint enabled.
121
			UNIQUE or PRIMARY KEY constraint enabled.
122
			
122
			
123
			Any newly created IndexSchema object 
123
			Any newly created IndexSchema object 
124
			has this flag set to false.
124
			has this flag set to false.
Lines 137-152 Link Here
137
		
137
		
138
		/*! Sets PRIMARY KEY flag. \sa isPrimary().
138
		/*! Sets PRIMARY KEY flag. \sa isPrimary().
139
		 Note: Setting PRIMARY KEY on (true), 
139
		 Note: Setting PRIMARY KEY on (true), 
140
		 UNITQUE flag will be also implicity set. */
140
		 UNIQUE flag will be also implicity set. */
141
		void setPrimaryKey(bool set);
141
		void setPrimaryKey(bool set);
142
142
143
		/*! \return true if this is unique index. 
143
		/*! \return true if this is unique index. 
144
		 This can be one or multifield. */
144
		 This can be one or multifield. */
145
		bool isUnique() const;
145
		bool isUnique() const;
146
		
146
		
147
		/*! Sets UNITQUE flag. \sa isUnique(). 
147
		/*! Sets UNIQUE flag. \sa isUnique(). 
148
		 Note: Setting UNITQUE off (false), PRIMARY KEY flag will 
148
		 Note: Setting UNIQUE off (false), PRIMARY KEY flag will 
149
		 be also implicity set off, because this UNITQUE 
149
		 be also implicity set off, because this UNIQUE 
150
		 is the requirement for PRIMARY KEYS. */
150
		 is the requirement for PRIMARY KEYS. */
151
		void setUnique(bool set);
151
		void setUnique(bool set);
152
152
(-)koffice/kexi.new/kexidb/keywords.cpp (-1 / +1 lines)
Lines 82-88 Link Here
82
		"THEN",
82
		"THEN",
83
		"TRANSACTION",
83
		"TRANSACTION",
84
		"UNION",
84
		"UNION",
85
		"UNITQUE",
85
		"UNIQUE",
86
		"UPDATE",
86
		"UPDATE",
87
		"USING",
87
		"USING",
88
		"VALUES",
88
		"VALUES",
(-)koffice/kexi.new/kexidb/parser/sqlparser.cpp (-18 / +18 lines)
Lines 174-185 Link Here
174
     DISTINCT = 363,
174
     DISTINCT = 363,
175
     DOMAIN_TOKEN = 364,
175
     DOMAIN_TOKEN = 364,
176
     SQL_DOUBLE = 365,
176
     SQL_DOUBLE = 365,
177
     DOUBLE_TQUOTED_STRING = 366,
177
     DOUBLE_QUOTED_STRING = 366,
178
     DROP = 367,
178
     DROP = 367,
179
     ELSE = 368,
179
     ELSE = 368,
180
     END = 369,
180
     END = 369,
181
     END_EXEC = 370,
181
     END_EXEC = 370,
182
     ETQUAL = 371,
182
     EQUAL = 371,
183
     ESCAPE = 372,
183
     ESCAPE = 372,
184
     EXCEPT = 373,
184
     EXCEPT = 373,
185
     SQL_EXCEPTION = 374,
185
     SQL_EXCEPTION = 374,
Lines 296-302 Link Here
296
     PARTIAL = 485,
296
     PARTIAL = 485,
297
     SQL_PASCAL = 486,
297
     SQL_PASCAL = 486,
298
     PERSISTENT = 487,
298
     PERSISTENT = 487,
299
     CTQL_PI = 488,
299
     CQL_PI = 488,
300
     PLI = 489,
300
     PLI = 489,
301
     POSITION = 490,
301
     POSITION = 490,
302
     PRECISION = 491,
302
     PRECISION = 491,
Lines 308-315 Link Here
308
     PROCEDURE = 497,
308
     PROCEDURE = 497,
309
     PRODUCT = 498,
309
     PRODUCT = 498,
310
     PUBLIC = 499,
310
     PUBLIC = 499,
311
     TQUARTER = 500,
311
     QUARTER = 500,
312
     TQUIT = 501,
312
     QUIT = 501,
313
     RAND = 502,
313
     RAND = 502,
314
     READ_ONLY = 503,
314
     READ_ONLY = 503,
315
     REAL = 504,
315
     REAL = 504,
Lines 381-387 Link Here
381
     TWO_DIGITS = 570,
381
     TWO_DIGITS = 570,
382
     UCASE = 571,
382
     UCASE = 571,
383
     UNION = 572,
383
     UNION = 572,
384
     UNITQUE = 573,
384
     UNIQUE = 573,
385
     SQL_UNKNOWN = 574,
385
     SQL_UNKNOWN = 574,
386
     UPDATE = 575,
386
     UPDATE = 575,
387
     UPPER = 576,
387
     UPPER = 576,
Lines 389-395 Link Here
389
     USER = 578,
389
     USER = 578,
390
     IDENTIFIER = 579,
390
     IDENTIFIER = 579,
391
     IDENTIFIER_DOT_ASTERISK = 580,
391
     IDENTIFIER_DOT_ASTERISK = 580,
392
     TQUERY_PARAMETER = 581,
392
     QUERY_PARAMETER = 581,
393
     USING = 582,
393
     USING = 582,
394
     VALUE = 583,
394
     VALUE = 583,
395
     VALUES = 584,
395
     VALUES = 584,
Lines 524-535 Link Here
524
#define DISTINCT 363
524
#define DISTINCT 363
525
#define DOMAIN_TOKEN 364
525
#define DOMAIN_TOKEN 364
526
#define SQL_DOUBLE 365
526
#define SQL_DOUBLE 365
527
#define DOUBLE_TQUOTED_STRING 366
527
#define DOUBLE_QUOTED_STRING 366
528
#define DROP 367
528
#define DROP 367
529
#define ELSE 368
529
#define ELSE 368
530
#define END 369
530
#define END 369
531
#define END_EXEC 370
531
#define END_EXEC 370
532
#define ETQUAL 371
532
#define EQUAL 371
533
#define ESCAPE 372
533
#define ESCAPE 372
534
#define EXCEPT 373
534
#define EXCEPT 373
535
#define SQL_EXCEPTION 374
535
#define SQL_EXCEPTION 374
Lines 646-652 Link Here
646
#define PARTIAL 485
646
#define PARTIAL 485
647
#define SQL_PASCAL 486
647
#define SQL_PASCAL 486
648
#define PERSISTENT 487
648
#define PERSISTENT 487
649
#define CTQL_PI 488
649
#define CQL_PI 488
650
#define PLI 489
650
#define PLI 489
651
#define POSITION 490
651
#define POSITION 490
652
#define PRECISION 491
652
#define PRECISION 491
Lines 658-665 Link Here
658
#define PROCEDURE 497
658
#define PROCEDURE 497
659
#define PRODUCT 498
659
#define PRODUCT 498
660
#define PUBLIC 499
660
#define PUBLIC 499
661
#define TQUARTER 500
661
#define QUARTER 500
662
#define TQUIT 501
662
#define QUIT 501
663
#define RAND 502
663
#define RAND 502
664
#define READ_ONLY 503
664
#define READ_ONLY 503
665
#define REAL 504
665
#define REAL 504
Lines 731-737 Link Here
731
#define TWO_DIGITS 570
731
#define TWO_DIGITS 570
732
#define UCASE 571
732
#define UCASE 571
733
#define UNION 572
733
#define UNION 572
734
#define UNITQUE 573
734
#define UNIQUE 573
735
#define SQL_UNKNOWN 574
735
#define SQL_UNKNOWN 574
736
#define UPDATE 575
736
#define UPDATE 575
737
#define UPPER 576
737
#define UPPER 576
Lines 739-745 Link Here
739
#define USER 578
739
#define USER 578
740
#define IDENTIFIER 579
740
#define IDENTIFIER 579
741
#define IDENTIFIER_DOT_ASTERISK 580
741
#define IDENTIFIER_DOT_ASTERISK 580
742
#define TQUERY_PARAMETER 581
742
#define QUERY_PARAMETER 581
743
#define USING 582
743
#define USING 582
744
#define VALUE 583
744
#define VALUE 583
745
#define VALUES 584
745
#define VALUES 584
Lines 1290-1297 Link Here
1290
  "DEC", "DECLARE", "DEFAULT", "DEFERRABLE", "DEFERRED", "SQL_DELETE",
1290
  "DEC", "DECLARE", "DEFAULT", "DEFERRABLE", "DEFERRED", "SQL_DELETE",
1291
  "DESC", "DESCRIBE", "DESCRIPTOR", "DIAGNOSTICS", "DICTIONARY",
1291
  "DESC", "DESCRIBE", "DESCRIPTOR", "DIAGNOSTICS", "DICTIONARY",
1292
  "DIRECTORY", "DISCONNECT", "DISPLACEMENT", "DISTINCT", "DOMAIN_TOKEN",
1292
  "DIRECTORY", "DISCONNECT", "DISPLACEMENT", "DISTINCT", "DOMAIN_TOKEN",
1293
  "SQL_DOUBLE", "DOUBLE_TQUOTED_STRING", "DROP", "ELSE", "END", "END_EXEC",
1293
  "SQL_DOUBLE", "DOUBLE_QUOTED_STRING", "DROP", "ELSE", "END", "END_EXEC",
1294
  "ETQUAL", "ESCAPE", "EXCEPT", "SQL_EXCEPTION", "EXEC", "EXECUTE",
1294
  "EQUAL", "ESCAPE", "EXCEPT", "SQL_EXCEPTION", "EXEC", "EXECUTE",
1295
  "EXISTS", "EXP", "EXPONENT", "EXTERNAL", "EXTRACT", "SQL_FALSE", "FETCH",
1295
  "EXISTS", "EXP", "EXPONENT", "EXTERNAL", "EXTRACT", "SQL_FALSE", "FETCH",
1296
  "FIRST", "SQL_FLOAT", "FLOOR", "FN", "FOR", "FOREIGN", "FORTRAN",
1296
  "FIRST", "SQL_FLOAT", "FLOOR", "FN", "FOR", "FOREIGN", "FORTRAN",
1297
  "FOUND", "FOUR_DIGITS", "FROM", "FULL", "GET", "GLOBAL", "GO", "GOTO",
1297
  "FOUND", "FOUR_DIGITS", "FROM", "FULL", "GET", "GLOBAL", "GO", "GOTO",
Lines 1308-1314 Link Here
1308
  "NOW", "SQL_NULL", "SQL_IS", "SQL_IS_NULL", "SQL_IS_NOT_NULL", "NULLIF",
1308
  "NOW", "SQL_NULL", "SQL_IS", "SQL_IS_NULL", "SQL_IS_NOT_NULL", "NULLIF",
1309
  "NUMERIC", "OCTET_LENGTH", "ODBC", "OF", "SQL_OFF", "SQL_ON", "ONLY",
1309
  "NUMERIC", "OCTET_LENGTH", "ODBC", "OF", "SQL_OFF", "SQL_ON", "ONLY",
1310
  "OPEN", "OPTION", "OR", "ORDER", "OUTER", "OUTPUT", "OVERLAPS", "PAGE",
1310
  "OPEN", "OPTION", "OR", "ORDER", "OUTER", "OUTPUT", "OVERLAPS", "PAGE",
1311
  "PARTIAL", "SQL_PASCAL", "PERSISTENT", "CTQL_PI", "PLI", "POSITION",
1311
  "PARTIAL", "SQL_PASCAL", "PERSISTENT", "CQL_PI", "PLI", "POSITION",
1312
  "PRECISION", "PREPARE", "PRESERVE", "PRIMARY", "PRIOR", "PRIVILEGES",
1312
  "PRECISION", "PREPARE", "PRESERVE", "PRIMARY", "PRIOR", "PRIVILEGES",
1313
  "PROCEDURE", "PRODUCT", "PUBLIC", "QUARTER", "QUIT", "RAND", "READ_ONLY",
1313
  "PROCEDURE", "PRODUCT", "PUBLIC", "QUARTER", "QUIT", "RAND", "READ_ONLY",
1314
  "REAL", "REFERENCES", "REPEAT", "REPLACE", "RESTRICT", "REVOKE", "RIGHT",
1314
  "REAL", "REFERENCES", "REPEAT", "REPLACE", "RESTRICT", "REVOKE", "RIGHT",
Lines 1322-1328 Link Here
1322
  "TAN", "TEMPORARY", "THEN", "THREE_DIGITS", "TIME", "TIMESTAMP",
1322
  "TAN", "TEMPORARY", "THEN", "THREE_DIGITS", "TIME", "TIMESTAMP",
1323
  "TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TINYINT", "TO", "TO_CHAR",
1323
  "TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TINYINT", "TO", "TO_CHAR",
1324
  "TO_DATE", "TRANSACTION", "TRANSLATE", "TRANSLATION", "TRUNCATE",
1324
  "TO_DATE", "TRANSACTION", "TRANSLATE", "TRANSLATION", "TRUNCATE",
1325
  "GENERAL_TITLE", "TWO_DIGITS", "UCASE", "UNION", "UNITQUE", "SQL_UNKNOWN",
1325
  "GENERAL_TITLE", "TWO_DIGITS", "UCASE", "UNION", "UNIQUE", "SQL_UNKNOWN",
1326
  "UPDATE", "UPPER", "USAGE", "USER", "IDENTIFIER",
1326
  "UPDATE", "UPPER", "USAGE", "USER", "IDENTIFIER",
1327
  "IDENTIFIER_DOT_ASTERISK", "QUERY_PARAMETER", "USING", "VALUE", "VALUES",
1327
  "IDENTIFIER_DOT_ASTERISK", "QUERY_PARAMETER", "USING", "VALUE", "VALUES",
1328
  "VARBINARY", "VARCHAR", "VARYING", "VENDOR", "VIEW", "WEEK", "WHEN",
1328
  "VARBINARY", "VARCHAR", "VARYING", "VENDOR", "VIEW", "WEEK", "WHEN",
(-)koffice/kexi.new/kexidb/parser/sqlparser.h (-14 / +14 lines)
Lines 154-165 Link Here
154
     DISTINCT = 363,
154
     DISTINCT = 363,
155
     DOMAIN_TOKEN = 364,
155
     DOMAIN_TOKEN = 364,
156
     SQL_DOUBLE = 365,
156
     SQL_DOUBLE = 365,
157
     DOUBLE_TQUOTED_STRING = 366,
157
     DOUBLE_QUOTED_STRING = 366,
158
     DROP = 367,
158
     DROP = 367,
159
     ELSE = 368,
159
     ELSE = 368,
160
     END = 369,
160
     END = 369,
161
     END_EXEC = 370,
161
     END_EXEC = 370,
162
     ETQUAL = 371,
162
     EQUAL = 371,
163
     ESCAPE = 372,
163
     ESCAPE = 372,
164
     EXCEPT = 373,
164
     EXCEPT = 373,
165
     SQL_EXCEPTION = 374,
165
     SQL_EXCEPTION = 374,
Lines 276-282 Link Here
276
     PARTIAL = 485,
276
     PARTIAL = 485,
277
     SQL_PASCAL = 486,
277
     SQL_PASCAL = 486,
278
     PERSISTENT = 487,
278
     PERSISTENT = 487,
279
     CTQL_PI = 488,
279
     CQL_PI = 488,
280
     PLI = 489,
280
     PLI = 489,
281
     POSITION = 490,
281
     POSITION = 490,
282
     PRECISION = 491,
282
     PRECISION = 491,
Lines 288-295 Link Here
288
     PROCEDURE = 497,
288
     PROCEDURE = 497,
289
     PRODUCT = 498,
289
     PRODUCT = 498,
290
     PUBLIC = 499,
290
     PUBLIC = 499,
291
     TQUARTER = 500,
291
     QUARTER = 500,
292
     TQUIT = 501,
292
     QUIT = 501,
293
     RAND = 502,
293
     RAND = 502,
294
     READ_ONLY = 503,
294
     READ_ONLY = 503,
295
     REAL = 504,
295
     REAL = 504,
Lines 361-367 Link Here
361
     TWO_DIGITS = 570,
361
     TWO_DIGITS = 570,
362
     UCASE = 571,
362
     UCASE = 571,
363
     UNION = 572,
363
     UNION = 572,
364
     UNITQUE = 573,
364
     UNIQUE = 573,
365
     SQL_UNKNOWN = 574,
365
     SQL_UNKNOWN = 574,
366
     UPDATE = 575,
366
     UPDATE = 575,
367
     UPPER = 576,
367
     UPPER = 576,
Lines 369-375 Link Here
369
     USER = 578,
369
     USER = 578,
370
     IDENTIFIER = 579,
370
     IDENTIFIER = 579,
371
     IDENTIFIER_DOT_ASTERISK = 580,
371
     IDENTIFIER_DOT_ASTERISK = 580,
372
     TQUERY_PARAMETER = 581,
372
     QUERY_PARAMETER = 581,
373
     USING = 582,
373
     USING = 582,
374
     VALUE = 583,
374
     VALUE = 583,
375
     VALUES = 584,
375
     VALUES = 584,
Lines 504-515 Link Here
504
#define DISTINCT 363
504
#define DISTINCT 363
505
#define DOMAIN_TOKEN 364
505
#define DOMAIN_TOKEN 364
506
#define SQL_DOUBLE 365
506
#define SQL_DOUBLE 365
507
#define DOUBLE_TQUOTED_STRING 366
507
#define DOUBLE_QUOTED_STRING 366
508
#define DROP 367
508
#define DROP 367
509
#define ELSE 368
509
#define ELSE 368
510
#define END 369
510
#define END 369
511
#define END_EXEC 370
511
#define END_EXEC 370
512
#define ETQUAL 371
512
#define EQUAL 371
513
#define ESCAPE 372
513
#define ESCAPE 372
514
#define EXCEPT 373
514
#define EXCEPT 373
515
#define SQL_EXCEPTION 374
515
#define SQL_EXCEPTION 374
Lines 626-632 Link Here
626
#define PARTIAL 485
626
#define PARTIAL 485
627
#define SQL_PASCAL 486
627
#define SQL_PASCAL 486
628
#define PERSISTENT 487
628
#define PERSISTENT 487
629
#define CTQL_PI 488
629
#define CQL_PI 488
630
#define PLI 489
630
#define PLI 489
631
#define POSITION 490
631
#define POSITION 490
632
#define PRECISION 491
632
#define PRECISION 491
Lines 638-645 Link Here
638
#define PROCEDURE 497
638
#define PROCEDURE 497
639
#define PRODUCT 498
639
#define PRODUCT 498
640
#define PUBLIC 499
640
#define PUBLIC 499
641
#define TQUARTER 500
641
#define QUARTER 500
642
#define TQUIT 501
642
#define QUIT 501
643
#define RAND 502
643
#define RAND 502
644
#define READ_ONLY 503
644
#define READ_ONLY 503
645
#define REAL 504
645
#define REAL 504
Lines 711-717 Link Here
711
#define TWO_DIGITS 570
711
#define TWO_DIGITS 570
712
#define UCASE 571
712
#define UCASE 571
713
#define UNION 572
713
#define UNION 572
714
#define UNITQUE 573
714
#define UNIQUE 573
715
#define SQL_UNKNOWN 574
715
#define SQL_UNKNOWN 574
716
#define UPDATE 575
716
#define UPDATE 575
717
#define UPPER 576
717
#define UPPER 576
Lines 719-725 Link Here
719
#define USER 578
719
#define USER 578
720
#define IDENTIFIER 579
720
#define IDENTIFIER 579
721
#define IDENTIFIER_DOT_ASTERISK 580
721
#define IDENTIFIER_DOT_ASTERISK 580
722
#define TQUERY_PARAMETER 581
722
#define QUERY_PARAMETER 581
723
#define USING 582
723
#define USING 582
724
#define VALUE 583
724
#define VALUE 583
725
#define VALUES 584
725
#define VALUES 584
(-)koffice/kexi.new/kexidb/parser/sqlscanner.cpp (-1 / +1 lines)
Lines 1125-1131 Link Here
1125
	KexiDBDbg << "yytext: '" << yytext << "' (" << yyleng << ")" << endl;
1125
	KexiDBDbg << "yytext: '" << yytext << "' (" << yyleng << ")" << endl;
1126
	ECOUNT;
1126
	ECOUNT;
1127
	yylval.stringValue = new TQString(TQString::fromUtf8(yytext+1, yyleng-2));
1127
	yylval.stringValue = new TQString(TQString::fromUtf8(yytext+1, yyleng-2));
1128
	return TQUERY_PARAMETER;
1128
	return QUERY_PARAMETER;
1129
}
1129
}
1130
	YY_BREAK
1130
	YY_BREAK
1131
case 41:
1131
case 41:
(-)koffice/kexi.new/kexidb/queryschema.h (-2 / +2 lines)
Lines 17-24 Link Here
17
 * Boston, MA 02110-1301, USA.
17
 * Boston, MA 02110-1301, USA.
18
*/
18
*/
19
19
20
#ifndef KEXIDB_TQUERY_H
20
#ifndef KEXIDB_QUERY_H
21
#define KEXIDB_TQUERY_H
21
#define KEXIDB_QUERY_H
22
22
23
#include <tqvaluevector.h>
23
#include <tqvaluevector.h>
24
#include <tqstring.h>
24
#include <tqstring.h>
(-)koffice/kexi.new/kexidb/queryschemaparameter.h (-2 / +2 lines)
Lines 17-24 Link Here
17
 * Boston, MA 02110-1301, USA.
17
 * Boston, MA 02110-1301, USA.
18
*/
18
*/
19
19
20
#ifndef KEXIDB_TQUERYSCHEMAPARAMETER_H
20
#ifndef KEXIDB_QUERYSCHEMAPARAMETER_H
21
#define KEXIDB_TQUERYSCHEMAPARAMETER_H
21
#define KEXIDB_QUERYSCHEMAPARAMETER_H
22
22
23
#include "queryschema.h"
23
#include "queryschema.h"
24
24
(-)koffice/kexi.new/plugins/importexport/csv/kexicsvexport.cpp (-2 / +2 lines)
Lines 63-69 Link Here
63
	if (args.contains("textQuote"))
63
	if (args.contains("textQuote"))
64
		textQuote = args["textQuote"];
64
		textQuote = args["textQuote"];
65
	else
65
	else
66
		textQuote = (mode==File) ? KEXICSV_DEFAULT_FILE_TEXT_TQUOTE : KEXICSV_DEFAULT_CLIPBOARD_TEXT_TQUOTE;
66
		textQuote = (mode==File) ? KEXICSV_DEFAULT_FILE_TEXT_QUOTE : KEXICSV_DEFAULT_CLIPBOARD_TEXT_QUOTE;
67
67
68
	bool ok;
68
	bool ok;
69
	itemId = args["itemId"].toInt(&ok);
69
	itemId = args["itemId"].toInt(&ok);
Lines 95-101 Link Here
95
//! @todo look at rowCount whether the data is really large; 
95
//! @todo look at rowCount whether the data is really large; 
96
//!       if so: avoid copying to clipboard (or ask user) because of system memory
96
//!       if so: avoid copying to clipboard (or ask user) because of system memory
97
97
98
//! @todo OPTIMIZATION: use fieldsExpanded(true /*UNITQUE*/)
98
//! @todo OPTIMIZATION: use fieldsExpanded(true /*UNIQUE*/)
99
//! @todo OPTIMIZATION? (avoid multiple data retrieving) look for already fetched data within KexiProject..
99
//! @todo OPTIMIZATION? (avoid multiple data retrieving) look for already fetched data within KexiProject..
100
100
101
	KexiDB::QuerySchema* query = tableOrQuery.query();
101
	KexiDB::QuerySchema* query = tableOrQuery.query();
(-)koffice/kexi.new/plugins/importexport/csv/kexicsvexportwizard.cpp (-2 / +2 lines)
Lines 424-431 Link Here
424
TQString KexiCSVExportWizard::defaultTextQuote() const
424
TQString KexiCSVExportWizard::defaultTextQuote() const
425
{
425
{
426
	if (m_options.mode==KexiCSVExport::Clipboard)
426
	if (m_options.mode==KexiCSVExport::Clipboard)
427
		return KEXICSV_DEFAULT_CLIPBOARD_TEXT_TQUOTE;
427
		return KEXICSV_DEFAULT_CLIPBOARD_TEXT_QUOTE;
428
	return KEXICSV_DEFAULT_FILE_TEXT_TQUOTE;
428
	return KEXICSV_DEFAULT_FILE_TEXT_QUOTE;
429
}
429
}
430
430
431
#include "kexicsvexportwizard.moc"
431
#include "kexicsvexportwizard.moc"
(-)koffice/kexi.new/plugins/importexport/csv/kexicsvimportdialog.cpp (-1 / +1 lines)
Lines 156-162 Link Here
156
	m_cancelled( false ),
156
	m_cancelled( false ),
157
	m_adjustRows( true ),
157
	m_adjustRows( true ),
158
	m_startline( 0 ),
158
	m_startline( 0 ),
159
	m_textquote( TQString(KEXICSV_DEFAULT_FILE_TEXT_TQUOTE)[0] ),
159
	m_textquote( TQString(KEXICSV_DEFAULT_FILE_TEXT_QUOTE)[0] ),
160
	m_mode(mode),
160
	m_mode(mode),
161
	m_prevSelectedCol(-1),
161
	m_prevSelectedCol(-1),
162
	m_columnsAdjusted(false),
162
	m_columnsAdjusted(false),
(-)koffice/kexi.new/plugins/importexport/csv/kexicsvwidgets.h (-2 / +2 lines)
Lines 27-34 Link Here
27
class KActiveLabel;
27
class KActiveLabel;
28
class TQLabel;
28
class TQLabel;
29
29
30
#define KEXICSV_DEFAULT_FILE_TEXT_TQUOTE "\""
30
#define KEXICSV_DEFAULT_FILE_TEXT_QUOTE "\""
31
#define KEXICSV_DEFAULT_CLIPBOARD_TEXT_TQUOTE ""
31
#define KEXICSV_DEFAULT_CLIPBOARD_TEXT_QUOTE ""
32
#define KEXICSV_DEFAULT_FILE_DELIMITER ","
32
#define KEXICSV_DEFAULT_FILE_DELIMITER ","
33
#define KEXICSV_DEFAULT_CLIPBOARD_DELIMITER "\t"
33
#define KEXICSV_DEFAULT_CLIPBOARD_DELIMITER "\t"
34
#define KEXICSV_DEFAULT_FILE_DELIMITER_INDEX 0
34
#define KEXICSV_DEFAULT_FILE_DELIMITER_INDEX 0
(-)koffice/kexi.new/plugins/queries/kexidynamicqueryparameterdialog.h (-2 / +2 lines)
Lines 17-24 Link Here
17
 * Boston, MA 02110-1301, USA.
17
 * Boston, MA 02110-1301, USA.
18
 */
18
 */
19
19
20
#ifndef _KEXI_DYNAMIC_TQUERY_PARAMETER_DIALOG_H_
20
#ifndef _KEXI_DYNAMIC_QUERY_PARAMETER_DIALOG_H_
21
#define _KEXI_DYNAMIC_TQUERY_PARAMETER_DIALOG_H_
21
#define _KEXI_DYNAMIC_QUERY_PARAMETER_DIALOG_H_
22
22
23
23
24
#include <kdialogbase.h>
24
#include <kdialogbase.h>
(-)koffice/kexi.new/plugins/queries/kexiquerydesignerguieditor.cpp (-10 / +10 lines)
Lines 56-69 Link Here
56
56
57
#include "kexiquerypart.h"
57
#include "kexiquerypart.h"
58
58
59
//! @todo remove KEXI_NO_TQUERY_TOTALS later
59
//! @todo remove KEXI_NO_QUERY_TOTALS later
60
#define KEXI_NO_TQUERY_TOTALS
60
#define KEXI_NO_QUERY_TOTALS
61
61
62
//! indices for table columns
62
//! indices for table columns
63
#define COLUMN_ID_COLUMN 0
63
#define COLUMN_ID_COLUMN 0
64
#define COLUMN_ID_TABLE 1
64
#define COLUMN_ID_TABLE 1
65
#define COLUMN_ID_VISIBLE 2
65
#define COLUMN_ID_VISIBLE 2
66
#ifdef KEXI_NO_TQUERY_TOTALS
66
#ifdef KEXI_NO_QUERY_TOTALS
67
# define COLUMN_ID_SORTING 3
67
# define COLUMN_ID_SORTING 3
68
# define COLUMN_ID_CRITERIA 4
68
# define COLUMN_ID_CRITERIA 4
69
#else
69
#else
Lines 226-232 Link Here
226
	col3->field()->setNotNull( true );
226
	col3->field()->setNotNull( true );
227
	d->data->addColumn(col3);
227
	d->data->addColumn(col3);
228
228
229
#ifndef KEXI_NO_TQUERY_TOTALS
229
#ifndef KEXI_NO_QUERY_TOTALS
230
	KexiTableViewColumn *col4 = new KexiTableViewColumn("totals", KexiDB::Field::Enum, i18n("Totals"),
230
	KexiTableViewColumn *col4 = new KexiTableViewColumn("totals", KexiDB::Field::Enum, i18n("Totals"),
231
		i18n("Describes a way of computing totals for a given field or expression."));
231
		i18n("Describes a way of computing totals for a given field or expression."));
232
	TQValueVector<TQString> totalsTypes;
232
	TQValueVector<TQString> totalsTypes;
Lines 1200-1206 Link Here
1200
	(*newItem)[COLUMN_ID_COLUMN]=key;
1200
	(*newItem)[COLUMN_ID_COLUMN]=key;
1201
	(*newItem)[COLUMN_ID_TABLE]=tableName;
1201
	(*newItem)[COLUMN_ID_TABLE]=tableName;
1202
	(*newItem)[COLUMN_ID_VISIBLE]=TQVariant(visible, 1);
1202
	(*newItem)[COLUMN_ID_VISIBLE]=TQVariant(visible, 1);
1203
#ifndef KEXI_NO_TQUERY_TOTALS
1203
#ifndef KEXI_NO_QUERY_TOTALS
1204
	(*newItem)[COLUMN_ID_TOTALS]=TQVariant(0);
1204
	(*newItem)[COLUMN_ID_TOTALS]=TQVariant(0);
1205
#endif
1205
#endif
1206
	return newItem;
1206
	return newItem;
Lines 1422-1428 Link Here
1422
			d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(), false/*!allowSignals*/);
1422
			d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(), false/*!allowSignals*/);
1423
			d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible
1423
			d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible
1424
			d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, TQVariant());
1424
			d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, TQVariant());
1425
#ifndef KEXI_NO_TQUERY_TOTALS
1425
#ifndef KEXI_NO_QUERY_TOTALS
1426
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals
1426
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals
1427
#endif
1427
#endif
1428
			d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, TQVariant());//remove crit.
1428
			d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, TQVariant());//remove crit.
Lines 1500-1506 Link Here
1500
			}
1500
			}
1501
			d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(tableName), false/*!allowSignals*/);
1501
			d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(tableName), false/*!allowSignals*/);
1502
			d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(true,1));
1502
			d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(true,1));
1503
#ifndef KEXI_NO_TQUERY_TOTALS
1503
#ifndef KEXI_NO_QUERY_TOTALS
1504
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0));
1504
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0));
1505
#endif
1505
#endif
1506
			if (!sortingAllowed(fieldName, tableName)) {
1506
			if (!sortingAllowed(fieldName, tableName)) {
Lines 1533-1539 Link Here
1533
			if (!item->at(COLUMN_ID_COLUMN).toString().isEmpty())
1533
			if (!item->at(COLUMN_ID_COLUMN).toString().isEmpty())
1534
				d->data->updateRowEditBuffer(item, COLUMN_ID_COLUMN, TQVariant(), false/*!allowSignals*/);
1534
				d->data->updateRowEditBuffer(item, COLUMN_ID_COLUMN, TQVariant(), false/*!allowSignals*/);
1535
			d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible
1535
			d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible
1536
#ifndef KEXI_NO_TQUERY_TOTALS
1536
#ifndef KEXI_NO_QUERY_TOTALS
1537
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals
1537
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals
1538
#endif
1538
#endif
1539
			d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, TQVariant());//remove crit.
1539
			d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, TQVariant());//remove crit.
Lines 1560-1566 Link Here
1560
			saveOldValue = false;
1560
			saveOldValue = false;
1561
			createPropertySet( d->dataTable->dataAwareObject()->currentRow(),
1561
			createPropertySet( d->dataTable->dataAwareObject()->currentRow(),
1562
				item->at(COLUMN_ID_TABLE).toString(), item->at(COLUMN_ID_COLUMN).toString(), true );
1562
				item->at(COLUMN_ID_TABLE).toString(), item->at(COLUMN_ID_COLUMN).toString(), true );
1563
#ifndef KEXI_NO_TQUERY_TOTALS
1563
#ifndef KEXI_NO_QUERY_TOTALS
1564
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0));//totals
1564
			d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0));//totals
1565
#endif
1565
#endif
1566
			propertySetSwitched();
1566
			propertySetSwitched();
Lines 1568-1574 Link Here
1568
		KoProperty::Set &set = *propertySet();
1568
		KoProperty::Set &set = *propertySet();
1569
		set["visible"].setValue(newValue, saveOldValue);
1569
		set["visible"].setValue(newValue, saveOldValue);
1570
	}
1570
	}
1571
#ifndef KEXI_NO_TQUERY_TOTALS
1571
#ifndef KEXI_NO_QUERY_TOTALS
1572
	else if (colnum==COLUMN_ID_TOTALS) {
1572
	else if (colnum==COLUMN_ID_TOTALS) {
1573
		//TODO:
1573
		//TODO:
1574
		//unused yet
1574
		//unused yet
(-)koffice/kexi.new/plugins/queries/kexiquerydesignerguieditor.h (-2 / +2 lines)
Lines 18-25 Link Here
18
 * Boston, MA 02110-1301, USA.
18
 * Boston, MA 02110-1301, USA.
19
*/
19
*/
20
20
21
#ifndef KEXITQUERYDESIGNERGUIEDITOR_H
21
#ifndef KEXIQUERYDESIGNERGUIEDITOR_H
22
#define KEXITQUERYDESIGNERGUIEDITOR_H
22
#define KEXIQUERYDESIGNERGUIEDITOR_H
23
23
24
#include <tqguardedptr.h>
24
#include <tqguardedptr.h>
25
#include <tqsplitter.h>
25
#include <tqsplitter.h>
(-)koffice/kexi.new/plugins/queries/kexiquerydesignersql.h (-2 / +2 lines)
Lines 18-25 Link Here
18
 * Boston, MA 02110-1301, USA.
18
 * Boston, MA 02110-1301, USA.
19
*/
19
*/
20
20
21
#ifndef KEXITQUERYDESIGNERSQL_H
21
#ifndef KEXIQUERYDESIGNERSQL_H
22
#define KEXITQUERYDESIGNERSQL_H
22
#define KEXIQUERYDESIGNERSQL_H
23
23
24
#include <kexiviewbase.h>
24
#include <kexiviewbase.h>
25
#include "kexiquerypart.h"
25
#include "kexiquerypart.h"
(-)koffice/kexi.new/plugins/queries/kexiquerydesignersqlhistory.h (-2 / +2 lines)
Lines 18-25 Link Here
18
 * Boston, MA 02110-1301, USA.
18
 * Boston, MA 02110-1301, USA.
19
*/
19
*/
20
20
21
#ifndef KEXITQUERYDESIGNERSQLHISTORY_H
21
#ifndef KEXIQUERYDESIGNERSQLHISTORY_H
22
#define KEXITQUERYDESIGNERSQLHISTORY_H
22
#define KEXIQUERYDESIGNERSQLHISTORY_H
23
23
24
#include <tqscrollview.h>
24
#include <tqscrollview.h>
25
#include <tqdatetime.h>
25
#include <tqdatetime.h>
(-)koffice/kexi.new/plugins/queries/kexiquerypart.h (-2 / +2 lines)
Lines 18-25 Link Here
18
 * Boston, MA 02110-1301, USA.
18
 * Boston, MA 02110-1301, USA.
19
*/
19
*/
20
20
21
#ifndef KEXITQUERYPART_H
21
#ifndef KEXIQUERYPART_H
22
#define KEXITQUERYPART_H
22
#define KEXIQUERYPART_H
23
23
24
#include <tqmap.h>
24
#include <tqmap.h>
25
25
(-)koffice/kexi.new/plugins/queries/kexiqueryview.h (-2 / +2 lines)
Lines 18-25 Link Here
18
 * Boston, MA 02110-1301, USA.
18
 * Boston, MA 02110-1301, USA.
19
*/
19
*/
20
20
21
#ifndef KEXITQUERYVIEW_H
21
#ifndef KEXIQUERYVIEW_H
22
#define KEXITQUERYVIEW_H
22
#define KEXIQUERYVIEW_H
23
23
24
#include <kexidatatable.h>
24
#include <kexidatatable.h>
25
25
(-)koffice/kexi.new/widget/kexiquerydesignersqleditor.h (-2 / +2 lines)
Lines 19-26 Link Here
19
 * Boston, MA 02110-1301, USA.
19
 * Boston, MA 02110-1301, USA.
20
*/
20
*/
21
21
22
#ifndef KEXITQUERYDESIGNERSQLEDITOR_H
22
#ifndef KEXIQUERYDESIGNERSQLEDITOR_H
23
#define KEXITQUERYDESIGNERSQLEDITOR_H
23
#define KEXIQUERYDESIGNERSQLEDITOR_H
24
24
25
#include "kexieditor.h"
25
#include "kexieditor.h"
26
26
(-)koffice/kexi.new/widget/kexiqueryparameters.h (-2 / +2 lines)
Lines 17-24 Link Here
17
 * Boston, MA 02110-1301, USA.
17
 * Boston, MA 02110-1301, USA.
18
*/
18
*/
19
19
20
#ifndef KEXITQUERYPARAMETERS_H
20
#ifndef KEXIQUERYPARAMETERS_H
21
#define KEXITQUERYPARAMETERS_H
21
#define KEXIQUERYPARAMETERS_H
22
22
23
#include <kexidb/queryschema.h>
23
#include <kexidb/queryschema.h>
24
24
(-)koffice/lib/kformula/kformulacompatibility.cc (-1 / +1 lines)
Lines 45-51 Link Here
45
const BoxType OF_LSUP = '6' + UNUSED_OFFSET;
45
const BoxType OF_LSUP = '6' + UNUSED_OFFSET;
46
const BoxType OF_LSUB = '%' + UNUSED_OFFSET;
46
const BoxType OF_LSUB = '%' + UNUSED_OFFSET;
47
//const BoxType PAREN = '(';
47
//const BoxType PAREN = '(';
48
//const BoxType ETQUAL = '=';
48
//const BoxType EQUAL = '=';
49
//const BoxType MORE = '>';
49
//const BoxType MORE = '>';
50
//const BoxType LESS = '<';
50
//const BoxType LESS = '<';
51
//const BoxType ABS = '|';
51
//const BoxType ABS = '|';

Return to bug 782