<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    40 MySQL Technical Reference for Version 4.0.3 1.7.4.7  `--' as the Start of a Comment Some other SQL databases use `--' to start comments.  MySQL Server has `#' as the start comment character.  You can also use the C comment style /* this is a comment */ with MySQL Server.  See Section 6.1.6 [Comments], page 385. MySQL  Server  Version  3.23.3  and  above  support  the  `--'  comment  style,  provided  the comment  is  followed  by  a  space.   This  is  because  this  comment  style  has  caused  many problems  with  automatically  generated  SQL  queries  that  have  used  something  like  the following code, where we automatically insert the value of the payment for !payment!: UPDATE tbl_name SET credit=credit-!payment! Think about what happens if the value of  payment  is negative.   Because  1--1  is legal in SQL, the consequences of allowing comments to start with `--' are terrible. Using our implementation of this method of commenting in MySQL Server Version 3.23.3 and up, 1-- This is a comment is actually safe. Another safe feature is that the mysql command-line client removes all lines that start with `--'. The following information is relevant only if you are running a MySQL version earlier than 3.23.3: If you have a SQL program in a text le that contains `--' comments you should use: shell> replace " --" " #" < text-file-with-funny-comments.sql \ | mysql database instead of the usual: shell> mysql database < text-file-with-funny-comments.sql You can also edit the command le \in place" to change the `--' comments to `#' comments: shell> replace " --" " #" -- text-file-with-funny-comments.sql Change them back with this command: shell> replace " #" " --" -- text-file-with-funny-comments.sql 1.7.5  Known Errors and Design De ciencies in MySQL The following problems are known and have a very high priority to get xed:    ANALYZE TABLE  on a BDB table may in some case make the table unusable until one has restarted mysqld.  When this happens you will see errors like the following in the MySQL error le: 001207 22:07:56   bdb:   log_flush: LSN past current end-of-log    Don't execute  ALTER TABLE  on a  BDB  table on which you are running multi-statement transactions until all those transactions complete.  (The transaction will probably be ignored.)    ANALYZE TABLEOPTIMIZE TABLE, and REPAIR TABLE may cause problems on tables for which you are using INSERT DELAYED.    Doing a  LOCK TABLE ...  and  FLUSH TABLES ...  doesn't guarantee that there isn't a half- nished transaction in progress on the table.
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    MERCHANT ACCOUNTS
    DEDICATED SERVERS
    E-COMMERCE HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN
    REGISTRATION
    MANAGE
    YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    Corporate Info
    ABOUT US
    OUR NETWORK
    CONTACT US
    SITE MAP
    Copyright © 2002 Dyntex Group, Inc. All Rights Reserved
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide