Icon View Incident Report

Serious Serious
Reported By: Fernando Monteiro
Reported On: 2/6/2004
For: Version 4.02 Build 1
# 1539 Single-Row SELECT COUNT(*) Statement Returns the Incorrect Count of the Total Records After Deletes

Select Count(*) from sometable without a WHERE clause does not return the correct number of records

DROP TABLE IF EXISTS "\memory\sometable";

CREATE TABLE IF NOT EXISTS "\memory\sometable"
(
   "MESSAGE_ID" VARCHAR(64) NOT NULL,
   "DATA_HORA_REALIZADA" TIMESTAMP,
   "ASSUNTO_FOLLOW_UP" VARCHAR(250),
   "CONTATO_FOLLOW_UP" VARCHAR(50),
   "TEXTO_FOLLOW_UP" MEMO,
   "DATA_HORA_CARGA" TIMESTAMP,
   "EMAIL_FROM" VARCHAR(64),
   "EMAIL_TO" VARCHAR(64),
NOCASE PRIMARY KEY ("MESSAGE_ID") COMPRESS FULL
LOCALE CODE 1046
ENCRYPTED WITH ''
USER MAJOR VERSION 1
);

CREATE NOCASE INDEX IF NOT EXISTS "DATA_HORA_REALIZADA_EMAILS" 
ON "\memory\sometable" 
("DATA_HORA_REALIZADA","EMAIL_FROM","EMAIL_TO") COMPRESS FULL;

insert into "\memory\sometable" values ('id1', 
'2004-02-06 
10:20:34', 'subject', 'fulano', 'body', 
'2004-02-06 10:21:34', 'a@a.com', 'b@b.com');
insert into "\memory\sometable" values ('id2', 
'2004-02-06 
10:20:34', 'subject', 'fulano', 'body', 
'2004-02-06 10:21:34', 'a@a.com', 'b@b.com');
insert into "\memory\sometable" values ('id3', 
'2004-02-06 
10:20:34', 'subject', 'fulano', 'body', 
'2004-02-06 10:21:34', 'a@a.com', 'b@b.com');
insert into "\memory\sometable" values ('id4', 
'2004-02-06 
10:20:34', 'subject', 'fulano', 'body', 
'2004-02-06 10:21:34', 'a@a.com', 'b@b.com');
insert into "\memory\sometable" values ('id5', 
'2004-02-06 
10:20:34', 'subject', 'fulano', 'body', 
'2004-02-06 10:21:34', 'a@a.com', 'b@b.com');

select count(*) from "\memory\sometable";

delete from "\memory\sometable";

select count(*) from "\memory\sometable";

/* the following line works
select count(*) from "\memory\sometable" where MESSAGE_ID <> 'id100';
*/



Resolution Resolution
Fixed Problem on 2/7/2004 in version 4.03 build 1
Image