Bug #18079 Limit to exec query
Submitted: 8 Mar 2006 16:04 Modified: 22 Mar 2006 12:14
Reporter: Lincoln Ferreira Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:3.51.11 OS:Windows (Win32)
Assigned to: Bogdan Degtyariov CPU Architecture:Any

[8 Mar 2006 16:04] Lincoln Ferreira
Description:
I can't run a long query using SQLExecDirect.
I think that the problem is the size limit to 1K, but my query have almost 2K and is possible that I need increase size to other table.

My Query:

CREATE TABLE mytable ( 
AutoSequencial bigint(20) unsigned NOT NULL auto_increment,
Status tinyint(3) unsigned zerofill NOT NULL default 0,
CMC7 binary(15) NOT NULL default 0,
Chave binary(15) NOT NULL default 0, 
Valor bigint(20) unsigned NOT NULL default 0,
DataVenc smallint(5) unsigned NOT NULL default 0,
CpfCnpj bigint(20) unsigned NOT NULL default 0,
TipCust tinyint(3) unsigned NOT NULL default 0,
Motivo tinyint(3) unsigned NOT NULL default 0, 
Controle binary(6) NOT NULL default 0, 
AgenDep smallint(5) unsigned NOT NULL default 0, 
ContaDep binary(6) NOT NULL default 0, 
BancoA smallint(5) unsigned NOT NULL default 0,
AgenA smallint(5) unsigned NOT NULL default 0, 
LoteIn int(10) unsigned NOT NULL default 0,
RemessaIn int(10) unsigned NOT NULL default 0, 
RemessaOut int(10) unsigned NOT NULL default 0,
DataIn smallint(5) unsigned NOT NULL default 0,
CodCli int(10) unsigned NOT NULL default 0,
CodIncon smallint(5) unsigned NOT NULL default 0,
SeqCap int(10) unsigned NOT NULL default 0,
LoteSai int(10) unsigned NOT NULL default 0, 
Banco smallint(5) unsigned NOT NULL default 0, 
Agencia smallint(5) unsigned NOT NULL default 0, 
Conta bigint(20) unsigned NOT NULL default 0,
Numero int(10) unsigned NOT NULL default 0,
Alterado tinyint(1) unsigned NOT NULL default 0, 
Bloqueado tinyint(1) unsigned NOT NULL default 0,
Cancelado tinyint(1) unsigned NOT NULL default 0,
CancelProg tinyint(1) unsigned NOT NULL default 0, 
Digitado tinyint(1) unsigned NOT NULL default 0, 
DocNAK tinyint(1) unsigned NOT NULL default 0, 
DocNOK tinyint(1) unsigned NOT NULL default 0, 
Duplicado tinyint(1) unsigned NOT NULL default 0,
Escaninho smallint(5) unsigned NOT NULL default 0, 
Logado tinyint(1) unsigned NOT NULL default 0, 
Vistar tinyint(1) unsigned NOT NULL default 0, 
InfoCtrl binary(2) NOT NULL default 0, 
InfoImg binary(16) NOT NULL default 0, 
EstacaoLock smallint(5) unsigned NOT NULL default 0, 
Comp smallint(5) unsigned NOT NULL default 0,
PRIMARY KEY(AutoSequencial), 
KEY Numero (Numero), 
KEY CpfCnpj (CpfCnpj), 
KEY Chave (Chave),
KEY LinhaSup (Banco,Agencia,Conta,Numero)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1;

Size=2.200 bytes

How to repeat:
run this function using MyODBC 3.51.11 and the query above.
nRet=SQLExecDirect(hStat,szQuery,SQL_NTS);

Suggested fix:
Increase the buffer limit or turn off limit.
[21 Mar 2006 19:53] Bogdan Degtyariov
I can't repeat this bug neither with MyODBC 3.51.12 nor with MyODBC 3.51.11.
Above is the test case
[21 Mar 2006 19:54] Bogdan Degtyariov
test case

Attachment: test18079.c (text/plain), 6.10 KiB.

[22 Mar 2006 12:14] Lincoln Ferreira
I try to run your test program and get the real problem with my code.

This sintax to create an auto_increment field is wrong :
CREATE TABLE mytable (AutoSequencial bigint(20) unsigned NOT NULL auto_increment) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1;

The correct sintax is:
CREATE TABLE mytable (AutoSequencial bigint(20) unsigned NOT NULL auto_increment primary key) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1;

or

CREATE TABLE mytable (AutoSequencial bigint(20) unsigned NOT NULL auto_increment, PRIMARY KEY(AutoSequencial)) ENGINE=InnoDB DEFAULT CHARSET=latin1 CHECKSUM=1;