Re: escaped character problem
Here's what I get when I run that scriptlet through theUsual ...
Query: SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO" . OK. 12% done.
Query: SET AUTOCOMMIT = 0 . OK.
Query: START TRANSACTION . OK.
Query: SET time_zone = "+00:00" . OK. 12% done.
Query: /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */ . OK. 12% done.
Query: /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */ . OK. 12% done.
Query: /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */ . OK. 12% done.
Query: /*!40101 SET NAMES utf8mb4 */ . OK. 12% done.
Query: create database if not exists snoeptb . Rows changed: 1.
Query: use snoeptb . OK. 12% done.
Query: CREATE TABLE `ps_address` ( `id_address` int(10) UNSIGNED NOT NULL, `las.... OK. 12% done.
Query: INSERT INTO `ps_address` (`id_address`, `lastname`, `firstname`, `address1`, `.... Rows changed: 3. 12% done.
Query: ALTER TABLE `ps_address` ADD PRIMARY KEY (`id_address`) . Error: Duplicate entry '5' for key 'PRIMARY'12% done.
Query: ALTER TABLE `ps_address` MODIFY `id_address` int(10) UNSIGNED NOT NULL AUTO_.... Error: Incorrect table definition; there can be only one auto column and it must be defined as a key
Query: COMMIT . OK. 12% done.
Query: /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */ . OK. 12% done.
Query: /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */ . OK. 12% done.
Query: /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */ . OK.
As you can see, the ADD PK cmd fails because there are 2 rows where id=5.
Edited 1 time(s). Last edit at 10/02/2018 02:31PM by Peter Brawley.
Subject
Written By
Posted
Re: escaped character problem
October 02, 2018 02:30PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.