show warnings;
am 14.07.2009 02:20:23 von Artie Ziff
Hello,
I am returning to mysql after long break, so not experienced with
details. I inherited a text file with the mysql DDL statements which
create database and tables, etc. Each 'create' or 'drop' table statement
is preceded with a 'show warnings' statement. Since this file is used to
initialize a new database in mysql server, is there any reason to have
warnings enabled like this? It seems the warning would be generated 100%
of the time since the database did not exist before. So, my question is,
is there some good reason to include 'show warnings' statements into a
file that is intended to initialize a database that did not exist
before? It seems unnecessary however perhaps there is some situation
where this makes sense.
Cheers,
AZ
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: show warnings;
am 14.07.2009 03:30:02 von Michael Dykman
It is a little bit of paranoia which is not unhealthy. You might be
running those scripts on a dev server or a shared host where the
default warnings setting is not the default nor is it necessarily
under your control. You are right, warnings *should* be enabled by
default, but when you want to be guaranteed of consistent behaviour,
explicitly ask for what you want.
- michael dykman
On Mon, Jul 13, 2009 at 8:20 PM, Artie Ziff wrote:
> Hello,
>
> I am returning to mysql after long break, so not experienced with
> details. I inherited a text file with the mysql DDL statements which
> create database and tables, etc. Each 'create' or 'drop' table statement
> is preceded with a 'show warnings' statement. Since this file is used to
> initialize a new database in mysql server, is there any reason to have
> warnings enabled like this? It seems the warning would be generated 100%
> of the time since the database did not exist before. So, my question is,
> is there some good reason to include 'show warnings' statements into a
> file that is intended to initialize a database that did not exist
> before? It seems unnecessary however perhaps there is some situation
> where this makes sense.
>
> Cheers,
> AZ
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=mdykman@gmail.com
>
>
--
- michael dykman
- mdykman@gmail.com
- All models are wrong. Some models are useful.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: show warnings;
am 14.07.2009 17:33:32 von fire9
Artie,
Please tell us your MySQL version, support your error log.Thanks.
ÔÚ 2009-7-14£¬ÉÏÎç8:20£¬ Artie Ziff дµÀ£º=
> I am returning to mysql after long break, so not experienced with
> details. I inherited a text file with the mysql DDL statements which
> create database and tables, etc. Each 'create' or 'drop' table =20
> statement
> is preceded with a 'show warnings' statement. Since this file is =20
> used to
> initialize a new database in mysql server, is there any reason to have
> warnings enabled like this? It seems the warning would be generated =20=
> 100%
> of the time since the database did not exist before. So, my question =20=
> is,
> is there some good reason to include 'show warnings' statements into a
> file that is intended to initialize a database that did not exist
> before? It seems unnecessary however perhaps there is some situation
> where this makes sense.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg
RE: show warnings;
am 14.07.2009 17:39:52 von Jerry Schwartz
I hope you mean that the SHOW WARNINGS statements follow the DDL statements.
If the DROP statements have the IF EXISTS modifier, then there should not be
any warnings shown in the output. If there are, something (less severe than
an outright error) is wrong with the CREATE statement. It might be some kind
of type coercion, or who knows what, but it should be investigated.
>-----Original Message-----
>From: Artie Ziff [mailto:artie.ziff@gmail.com]
>Sent: Monday, July 13, 2009 8:20 PM
>To: mysql@lists.mysql.com
>Subject: show warnings;
>
>Hello,
>
>I am returning to mysql after long break, so not experienced with
>details. I inherited a text file with the mysql DDL statements which
>create database and tables, etc. Each 'create' or 'drop' table statement
>is preceded with a 'show warnings' statement. Since this file is used to
>initialize a new database in mysql server, is there any reason to have
>warnings enabled like this? It seems the warning would be generated 100%
>of the time since the database did not exist before. So, my question is,
>is there some good reason to include 'show warnings' statements into a
>file that is intended to initialize a database that did not exist
>before? It seems unnecessary however perhaps there is some situation
>where this makes sense.
>
>Cheers,
>AZ
>
>
>--
>MySQL General Mailing List
>For list archives: http://lists.mysql.com/mysql
>To unsubscribe: http://lists.mysql.com/mysql?unsub=jschwartz@the-
>infoshop.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org