MySQL Forums
Forum List  »  Newbie

Re: escaped character problem
Posted by: Peter Brawley
Date: October 02, 2018 02:30PM

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.

Options: ReplyQuote


Subject
Written By
Posted
October 02, 2018 08:37AM
October 02, 2018 09:59AM
October 02, 2018 01:03PM
Re: escaped character problem
October 02, 2018 02:30PM
October 04, 2018 06:36AM
October 04, 2018 08:22AM
October 07, 2018 02:05PM
October 07, 2018 03:27PM
October 02, 2018 02:14PM


Sorry, only registered users may post in this forum.

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.