Uniquely Indexed Column Problem

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Ðerek wildstar
Junior Boarder
Junior Boarder
Posts: 35
Joined: 30.08.2005, 16:30
Location: Olinda / PE
Contact:

Uniquely Indexed Column Problem

Post 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...
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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.
Image
Ðerek wildstar
Junior Boarder
Junior Boarder
Posts: 35
Joined: 30.08.2005, 16:30
Location: Olinda / PE
Contact:

Post by Ðerek wildstar »

Ok I'll do it Soon... Please wait! ;)

This is a very strang behaviour...
Ðerek wildstar
Junior Boarder
Junior Boarder
Posts: 35
Joined: 30.08.2005, 16:30
Location: Olinda / PE
Contact:

Post 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:
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post 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
Image
Ðerek wildstar
Junior Boarder
Junior Boarder
Posts: 35
Joined: 30.08.2005, 16:30
Location: Olinda / PE
Contact:

Post 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 [:)]
Post Reply