Page 1 of 1

Uniquely Indexed Column Problem

Posted: 01.09.2009, 13:52
by Ðerek wildstar
Hello everybody!

Recently i figure with a strange problem...

I have a form with a grid and some DBEdits. I have ZConnection, ZQuery, DataSource and a ZUpdateSQL. Everything is correctly linked, and all data types on the persistent fields (on ZQuery) are correct...

The table structure is

Code: Select all

CREATE TABLE `sistemas` (
  `BI_SISTEMAS_ID` bigint(20) NOT NULL AUTO_INCREMENT,
  `VA_NOME` varchar(30) NOT NULL,
  `VA_DIRETORIO` varchar(128) NOT NULL,
  `VA_DESCRICAO` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`BI_SISTEMAS_ID`),
  UNIQUE KEY `VA_NOME_UC` (`VA_NOME`),
  UNIQUE KEY `VA_DIRETORIO_UC` (`VA_DIRETORIO`)
) ENGINE=InnoDB CHARSET=latin1
Well...

I'm using MySQL Embed as database. The question is:

Why, I cannot type into the DBEdits linked to "VA_DIRETORIO" and "VA_NOME" the characters ' (single quote) and \ (backslash)?

I know, i cannot do this into a ordinary SQL statement (INSERT INTO) but using the Zeos Components and the BDE components i would be, right... The proof of this is the field "VA_DESCRICAO" i *CAN* type the mentioned characters and everything works OK...

Posted: 02.09.2009, 23:35
by mdaems
I tested this using a TDBgrid on D7 and no problem to insert quotes. (To be honest : using testing branch and Innodb disabled, so using myISAM.)
Here's the database dump:

Code: Select all

SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `sistemas` (
  `BI_SISTEMAS_ID` bigint(20) NOT NULL AUTO_INCREMENT,
  `VA_NOME` varchar(30) NOT NULL,
  `VA_DIRETORIO` varchar(128) NOT NULL,
  `VA_DESCRICAO` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`BI_SISTEMAS_ID`),
  UNIQUE KEY `VA_NOME_UC` (`VA_NOME`),
  UNIQUE KEY `VA_DIRETORIO_UC` (`VA_DIRETORIO`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client;
INSERT INTO `sistemas` VALUES (1,'\'','\'',NULL);
Can you make a simple test project to demonstrate your problem?

Mark

P.S. if you want to send a sample including your embedded dll and datafiles : send it to zeoslib at gmail.com.

Posted: 03.09.2009, 15:13
by Ðerek wildstar
Ok I'll do it Soon... Please wait! ;)

This is a very strang behaviour...

Posted: 03.09.2009, 19:09
by Ðerek wildstar
Sorry for this post... I've found the error into one of my custom components...

SORRY SO MUCH!

PLEASE. DELETE THIS TOPIC! :oops:

Posted: 05.09.2009, 00:00
by mdaems
Nope, I won't delete the topic. :P
So you'll never forget to look at custom components before reporting fake bugs :twisted:

Don't worry, the thread will sink away in the forum soon enough.

Mark

Posted: 08.09.2009, 12:46
by Ðerek wildstar
mdaems wrote:Nope, I won't delete the topic. :P
So you'll never forget to look at custom components before reporting fake bugs :twisted:

Don't worry, the thread will sink away in the forum soon enough.

Mark
Hehehe OK I will pay more attention next time [:)]