• Vamsikrishna Bhagi's avatar
    Bug#14463669 FAILURE TO CORRECTLY PARSE ROUTINES IN · 2217a9e3
    Vamsikrishna Bhagi authored
                 MYSQLDUMP OUTPUT
    
    Problem: mysqldump when used with option --routines, dumps
             all the routines of the specified database into
             output. The statements in this output are written
             in such a way that they are version safe using C
             style version commenting (of the format
             /*!<version num> <sql statement>*/). If a semicolon
             is present right before closing of the comment in
             dump output, it results in a syntax error while
             importing.
    
    
    Solution: Version comments for dumped routines are
              specifically to protect the ones older than 5.0.
              When the import is done on 5.0 or later versions,
              entire create statement gets executed as all the
              check conditions at the beginning of the comments
              are cleared. Since the trade off is between the
              performance of newer versions which are more in
              use and protection of very old versions which are
              no longer supported, it is proposed that these
              comments be removed altogether to maintain
              stability of the versions supported.
    
    client/mysqldump.c:
      Bug#14463669 FAILURE TO CORRECTLY PARSE ROUTINES IN
                   MYSQLDUMP OUTPUT
      
      Output of mysqldump is derived by getting the queries from
      show create and appending version comments to them.
      query_str is the variable used to store the final string.
      Since it is no longer required, its declaration and
      manipulations made on it are deleted. At the step where
      output is printed, query_str is replaced with the original
      query string derived from 'show create'.
    2217a9e3
mysqldump.result 217 KB