<< 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

    334 MySQL Technical Reference for Version 4.0.3    All columns has default values.    If you insert a 'wrong' value in a column like a NULL in a NOT NULL column or a too big numerical value in a numerical column, MySQL will instead of giving an error instead set the column to the 'best possible value'.  For numerical values this is 0, the smallest possible values or the largest possible value.  For strings this is either the empty string or the longest possible string that can be in the column.    All calculated expressions returns a value that can be used instead of signaling an error condition.  For example 1/0 returns NULL The reason for the above rules is that we can't check these conditions before the query starts to execute.  If we encounter a problem after updating a few rows, we can't just rollback as the table type may not support this.  We can't stop because in that case the update would be 'half done' which is probably the worst possible scenario.  In this case it's better to 'do the best you can' and then continue as if nothing happened. The above means that one should not use MySQL to check elds content, but one should do this in the application. 5.1.2  Portability Because all SQL servers implement di erent parts of SQL, it takes work to write portable SQL applications.  For very simple selects/inserts it is very easy, but the more you need the harder it gets.  If you want an application that is fast with many databases it becomes even harder! To make a complex application portable you need to choose a number of SQL servers that it should work with. You can use the MySQL crash-me program/web-page http://www.mysql.com/information/crash to nd functions, types, and limits you can use with a selection of database servers.  Crash- me  now  tests  far  from  everything  possible,  but  it  is  still  comprehensive  with  about  450 things tested. For example, you shouldn't have column names longer than 18 characters if you want to be able to use Informix or DB2. Both the MySQL benchmarks and crash-me programs are very database-independent.  By taking a look at how we have handled this, you can get a feeling for what you have to do to write your application database-independent.  The benchmarks themselves can be found in the `sql-bench' directory in the MySQL source distribution.  They are written in Perl with DBI database interface (which solves the access part of the problem). See   http://www.mysql.com/information/benchmarks.html   for  the  results  from  this benchmark. As you can see in these results, all databases have some weak points.  That is, they have di erent design compromises that lead to di erent behaviour. If you strive for database independence, you need to get a good feeling for each SQL server's bottlenecks.  MySQL is very fast in retrieving and updating things, but will have a problem in  mixing slow  readers/writers  on  the  same  table.   Oracle,  on  the  other hand,  has  a  big problem when you try to access rows that you have recently updated (until they are ushed
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN REGISTRATION
    MANAGE YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    SITE MAP
    Home
    Hosting Plans | Domain Registration | About Us | Contact Us | Site Map
    Terms of Use | Privacy Policy | Guarantees
    Merchant Accounts

    SpiritHost - web hosting for spiritual and education sites
    SpiritHit.com - Religious and Spiritual Portal
  • 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