无忧站长 >

MySQL 5.0新特性教程 存储过程

2019-11-01 14:45:28 
"SELECT n;"(n可以是0、1、2来标示运行到了哪条语句),调用后你就可以追中控制流来进行诊断了。如果是数据错误,则可以通过添加"DECLARE CONTINUE HANDLER FOR ... BEGIN END;"来跳过,因为往测试时数据库的数据不存在,因此跳过这个使我们可以继续进行。
Bugs 漏洞或缺陷
MySQL仍然是alpha版(译者语:软件中alpha版意思即内测,beta则是外测,翻译时已出beta版),其存储过程中仍有许多严重漏洞,我计算的
2004-10-27和2004-12-14的漏洞如下:
Bug Count On October 27 2004:
Category种类CountCauses Operating System To Reboot 1(导致系统重启)Crashes or Hangs 14(导致崩溃或挂起)Returns ’Packets out of order’ 5(返回’Packets out of order’)Fails 21--41
Bug Count On December 14 2004:
Category Count
Causes Operating System To Reboot 1
Crashes or Hangs 23
Returns ’Packets out of order’ 6
Fails 31
--
61
你可以通过访问MySQL漏洞发布网站来查询存储过程和触发器的错误,下面是步骤:
1.打开网址http://bugs.mysql.com
2.点击"Advanced Search"
3.在"Find bugs with any of the words"框中输入"procedure* trigger*".
4.在下拉框中默认为返回10个错误,然活选择"All"
5.点击"Boolean mode"
6.最后是点击"Search"
Feature Requests 将会出现的特性
摘要:
SIGNAL
PATH
Accessing Tables in Functions or Triggers
在函数或触发器中访问表BEGIN ATOMIC ... END
Encrypted storage
加密存储
Timeout
超时
Debugger
调试器
External Languages
外部语言特性
DROP ... CASCADE|RESTRICT
下面是我们急切需要添加的功能:
我们函数最需要的特性是拥有DB2和ANSI/ISO标准的强大功能,同时还需要超时功能使运行时间过长的循环或动作停止。Resources 您可以获得的资源
(I) MySQL的网站
(II) MySQL可供下载的资源
(III)教程和参考手册
在书的最后我将告诉读者获得更多信息的方法和地方。
MySQL网站
MySQL参考手册存储过程章节:
http://www.mysql.com/doc/en/Stored_Procedures.html
“MySQL存储过程”最新文章:
http://www.mysql.com/newsletter/2004-01/a0000000297.html
MySQL用户会议的幻灯片:
mysql.mirror.anlx.net/Downloads/Presentations/MySQL-User-Conference-2003/MySQL
-Stored-Procedures.pdf
这些都是你可以从网站获取的资源。
MySQL下载
> cd ~/mysql-5.0/mysql-test/t
> dir sp*
10025 2004-10-23 05:19 sp-error.test
3974 2004-10-23 05:19 sp-security.test
754 2004-08-07 08:51 sp-threads.test
45344 2004-10-24 06:09 sp.test
> cd ~/mysql-5.0/Docs
> dir sp*
41909 2004-08-05 09:19 sp-imp-spec.txt
4948 2004-08-05 09:19 sp-implemented.txt
如果需要更多的信息,你可以下载MySQL 5.0源代码包。当然我不是让读者去读代码本身,而是去阅读mysql-test目录里的测试脚本,在
Docs目录里有文档资料和新闻。(上面有操作过程)
Books 教程和参考手册
Understanding SQL’s Stored Procedures: A Complete Guide to SQL/PSM(书名,不翻译了)
作者Author: Jim Melton
发行Publisher: Morgan Kaufmann
Only available second-hand.
这是一本关于标准SQL存储过程的参考书,MySQL也尽量符合SQL标准,因此作为MySQL用户的您最好能有一本作为参考。
Conclusion结束语
到了最后我就不再去复述些什么概念了,相信大家可以记住全部的。如果您喜欢这本书,你可以在我们的网站找到更多"MySQL 5.0 New Features"系列书籍,下一本书将会是关于“触发器”和“视图”。
感谢您的关注,如果您对这本书有什么评论欢迎来MySQL论坛:http://forums.mysql.com/。
About MySQL (这部分就不翻译了了,估计大家也不看看,呵呵呵)
MySQL AB develops and supports a family of high performance, affordable database
servers and tools. The company’s flagship product is MySQL, the world’s most popular
open source database, with more than six million active installations. Many of the world’s
largest organizations, including Yahoo!, Sabre Holdings, The Associated Press, Suzuki
and NASA are realizing significant cost savings by using MySQL to power high-volume
Web sites, business-critical enterprise applications and packaged software.
With headquarters in Sweden and the United States ¨C and operations around the world ¨C
MySQL AB supports both open source values and corporate customers’ needs in a
profitable, sustainable business. For more information about MySQL, please visit
www.mysql.com.
译者的话:这是第一次做这样的尝试,所以挑选了这本比较入门的书来翻译,目的是对国内MySQL用户的支持,里面可能会有不少的错误,希望大家可以原谅里面的错误,但是我保证,错误只会是文法上的,绝对不会影响大家的操作。谢各位支持,转载时请保留作者信息和声明。这是Peter Gulutzan先生大作—《MySQL 5.0新特性》系列的第一册,以后我会抽空翻译此系列的其他资料,当然大家如果需要什么资料也可以给我写信,如果时间充足我会给您回复翻译,希望得到各位支持和鼓励,谢大家的阅读和宝贵意见。