home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 March (DVD) / PCWorld_2008-03_DVD.iso / komunikace / mysql / mysql-essential-5.0.45-win32.msi / product.cab / file514 < prev    next >
Unknown  |  2007-07-04  |  325.5 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text


This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
100% file data default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 03 0b 07 01 23 04 4a 4f | 49 4e 18 00 69 0a 4d 79 |....#.JO|IN..i.My|
|00000010| 53 51 4c 20 73 75 70 70 | 6f 72 74 73 20 74 68 65 |SQL supp|orts the|
|00000020| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 4a 4f 49 4e 20 | followi|ng JOIN |
|00000030| 73 79 6e 74 61 78 65 73 | 20 66 6f 72 20 74 68 65 |syntaxes| for the|
|00000040| 20 74 61 62 6c 65 5f 72 | 65 66 65 72 65 6e 63 65 | table_r|eference|
|00000050| 73 0a 70 61 72 74 20 6f | 66 20 53 45 4c 45 43 54 |s.part o|f SELECT|
|00000060| 20 73 74 61 74 65 6d 65 | 6e 74 73 20 61 6e 64 20 | stateme|nts and |
|00000070| 6d 75 6c 74 69 70 6c 65 | 2d 74 61 62 6c 65 20 44 |multiple|-table D|
|00000080| 45 4c 45 54 45 20 61 6e | 64 20 55 50 44 41 54 45 |ELETE an|d UPDATE|
|00000090| 0a 73 74 61 74 65 6d 65 | 6e 74 73 3a 0a 0a 74 61 |.stateme|nts:..ta|
|000000a0| 62 6c 65 5f 72 65 66 65 | 72 65 6e 63 65 73 3a 0a |ble_refe|rences:.|
|000000b0| 20 20 20 20 74 61 62 6c | 65 5f 72 65 66 65 72 65 | tabl|e_refere|
|000000c0| 6e 63 65 20 5b 2c 20 74 | 61 62 6c 65 5f 72 65 66 |nce [, t|able_ref|
|000000d0| 65 72 65 6e 63 65 5d 20 | 2e 2e 2e 0a 0a 74 61 62 |erence] |.....tab|
|000000e0| 6c 65 5f 72 65 66 65 72 | 65 6e 63 65 3a 0a 20 20 |le_refer|ence:. |
|000000f0| 20 20 74 61 62 6c 65 5f | 66 61 63 74 6f 72 0a 20 | table_|factor. |
|00000100| 20 7c 20 6a 6f 69 6e 5f | 74 61 62 6c 65 0a 0a 74 | | join_|table..t|
|00000110| 61 62 6c 65 5f 66 61 63 | 74 6f 72 3a 0a 20 20 20 |able_fac|tor:. |
|00000120| 20 74 62 6c 5f 6e 61 6d | 65 20 5b 5b 41 53 5d 20 | tbl_nam|e [[AS] |
|00000130| 61 6c 69 61 73 5d 20 5b | 69 6e 64 65 78 5f 68 69 |alias] [|index_hi|
|00000140| 6e 74 29 5d 0a 20 20 7c | 20 28 20 74 61 62 6c 65 |nt)]. || ( table|
|00000150| 5f 72 65 66 65 72 65 6e | 63 65 73 20 29 0a 20 20 |_referen|ces ). |
|00000160| 7c 20 7b 20 4f 4a 20 74 | 61 62 6c 65 5f 72 65 66 || { OJ t|able_ref|
|00000170| 65 72 65 6e 63 65 20 4c | 45 46 54 20 4f 55 54 45 |erence L|EFT OUTE|
|00000180| 52 20 4a 4f 49 4e 20 74 | 61 62 6c 65 5f 72 65 66 |R JOIN t|able_ref|
|00000190| 65 72 65 6e 63 65 0a 20 | 20 20 20 20 20 20 20 4f |erence. | O|
|000001a0| 4e 20 63 6f 6e 64 69 74 | 69 6f 6e 61 6c 5f 65 78 |N condit|ional_ex|
|000001b0| 70 72 20 7d 0a 0a 6a 6f | 69 6e 5f 74 61 62 6c 65 |pr }..jo|in_table|
|000001c0| 3a 0a 20 20 20 20 74 61 | 62 6c 65 5f 72 65 66 65 |:. ta|ble_refe|
|000001d0| 72 65 6e 63 65 20 5b 49 | 4e 4e 45 52 20 7c 20 43 |rence [I|NNER | C|
|000001e0| 52 4f 53 53 5d 20 4a 4f | 49 4e 20 74 61 62 6c 65 |ROSS] JO|IN table|
|000001f0| 5f 66 61 63 74 6f 72 20 | 5b 6a 6f 69 6e 5f 63 6f |_factor |[join_co|
|00000200| 6e 64 69 74 69 6f 6e 5d | 0a 20 20 7c 20 74 61 62 |ndition]|. | tab|
|00000210| 6c 65 5f 72 65 66 65 72 | 65 6e 63 65 20 53 54 52 |le_refer|ence STR|
|00000220| 41 49 47 48 54 5f 4a 4f | 49 4e 20 74 61 62 6c 65 |AIGHT_JO|IN table|
|00000230| 5f 66 61 63 74 6f 72 0a | 20 20 7c 20 74 61 62 6c |_factor.| | tabl|
|00000240| 65 5f 72 65 66 65 72 65 | 6e 63 65 20 53 54 52 41 |e_refere|nce STRA|
|00000250| 49 47 48 54 5f 4a 4f 49 | 4e 20 74 61 62 6c 65 5f |IGHT_JOI|N table_|
|00000260| 66 61 63 74 6f 72 20 4f | 4e 20 63 6f 6e 64 69 74 |factor O|N condit|
|00000270| 69 6f 6e 0a 20 20 7c 20 | 74 61 62 6c 65 5f 72 65 |ion. | |table_re|
|00000280| 66 65 72 65 6e 63 65 20 | 4c 45 46 54 20 5b 4f 55 |ference |LEFT [OU|
|00000290| 54 45 52 5d 20 4a 4f 49 | 4e 20 74 61 62 6c 65 5f |TER] JOI|N table_|
|000002a0| 72 65 66 65 72 65 6e 63 | 65 20 6a 6f 69 6e 5f 63 |referenc|e join_c|
|000002b0| 6f 6e 64 69 74 69 6f 6e | 0a 20 20 7c 20 74 61 62 |ondition|. | tab|
|000002c0| 6c 65 5f 72 65 66 65 72 | 65 6e 63 65 20 4e 41 54 |le_refer|ence NAT|
|000002d0| 55 52 41 4c 20 5b 4c 45 | 46 54 20 5b 4f 55 54 45 |URAL [LE|FT [OUTE|
|000002e0| 52 5d 5d 20 4a 4f 49 4e | 20 74 61 62 6c 65 5f 66 |R]] JOIN| table_f|
|000002f0| 61 63 74 6f 72 0a 20 20 | 7c 20 74 61 62 6c 65 5f |actor. || table_|
|00000300| 72 65 66 65 72 65 6e 63 | 65 20 52 49 47 48 54 20 |referenc|e RIGHT |
|00000310| 5b 4f 55 54 45 52 5d 20 | 4a 4f 49 4e 20 74 61 62 |[OUTER] |JOIN tab|
|00000320| 6c 65 5f 72 65 66 65 72 | 65 6e 63 65 20 6a 6f 69 |le_refer|ence joi|
|00000330| 6e 5f 63 6f 6e 64 69 74 | 69 6f 6e 0a 20 20 7c 20 |n_condit|ion. | |
|00000340| 74 61 62 6c 65 5f 72 65 | 66 65 72 65 6e 63 65 20 |table_re|ference |
|00000350| 4e 41 54 55 52 41 4c 20 | 5b 52 49 47 48 54 20 5b |NATURAL |[RIGHT [|
|00000360| 4f 55 54 45 52 5d 5d 20 | 4a 4f 49 4e 20 74 61 62 |OUTER]] |JOIN tab|
|00000370| 6c 65 5f 66 61 63 74 6f | 72 0a 0a 6a 6f 69 6e 5f |le_facto|r..join_|
|00000380| 63 6f 6e 64 69 74 69 6f | 6e 3a 0a 20 20 20 20 4f |conditio|n:. O|
|00000390| 4e 20 63 6f 6e 64 69 74 | 69 6f 6e 61 6c 5f 65 78 |N condit|ional_ex|
|000003a0| 70 72 0a 20 20 7c 20 55 | 53 49 4e 47 20 28 63 6f |pr. | U|SING (co|
|000003b0| 6c 75 6d 6e 5f 6c 69 73 | 74 29 0a 0a 69 6e 64 65 |lumn_lis|t)..inde|
|000003c0| 78 5f 68 69 6e 74 3a 0a | 20 20 20 20 55 53 45 20 |x_hint:.| USE |
|000003d0| 7b 49 4e 44 45 58 7c 4b | 45 59 7d 20 5b 46 4f 52 |{INDEX|K|EY} [FOR|
|000003e0| 20 4a 4f 49 4e 5d 20 28 | 69 6e 64 65 78 5f 6c 69 | JOIN] (|index_li|
|000003f0| 73 74 29 5d 0a 20 20 7c | 20 49 47 4e 4f 52 45 20 |st)]. || IGNORE |
|00000400| 7b 49 4e 44 45 58 7c 4b | 45 59 7d 20 5b 46 4f 52 |{INDEX|K|EY} [FOR|
|00000410| 20 4a 4f 49 4e 5d 20 28 | 69 6e 64 65 78 5f 6c 69 | JOIN] (|index_li|
|00000420| 73 74 29 5d 0a 20 20 7c | 20 46 4f 52 43 45 20 7b |st)]. || FORCE {|
|00000430| 49 4e 44 45 58 7c 4b 45 | 59 7d 20 5b 46 4f 52 20 |INDEX|KE|Y} [FOR |
|00000440| 4a 4f 49 4e 5d 20 28 69 | 6e 64 65 78 5f 6c 69 73 |JOIN] (i|ndex_lis|
|00000450| 74 29 5d 0a 0a 69 6e 64 | 65 78 5f 6c 69 73 74 3a |t)]..ind|ex_list:|
|00000460| 0a 20 20 20 20 69 6e 64 | 65 78 5f 6e 61 6d 65 20 |. ind|ex_name |
|00000470| 5b 2c 20 69 6e 64 65 78 | 5f 6e 61 6d 65 5d 20 2e |[, index|_name] .|
|00000480| 2e 2e 0a 0a 41 20 74 61 | 62 6c 65 20 72 65 66 65 |....A ta|ble refe|
|00000490| 72 65 6e 63 65 20 69 73 | 20 61 6c 73 6f 20 6b 6e |rence is| also kn|
|000004a0| 6f 77 6e 20 61 73 20 61 | 20 6a 6f 69 6e 20 65 78 |own as a| join ex|
|000004b0| 70 72 65 73 73 69 6f 6e | 2e 0a 0a 54 68 65 20 73 |pression|...The s|
|000004c0| 79 6e 74 61 78 20 6f 66 | 20 74 61 62 6c 65 5f 66 |yntax of| table_f|
|000004d0| 61 63 74 6f 72 20 69 73 | 20 65 78 74 65 6e 64 65 |actor is| extende|
|000004e0| 64 20 69 6e 20 63 6f 6d | 70 61 72 69 73 6f 6e 20 |d in com|parison |
|000004f0| 77 69 74 68 20 74 68 65 | 20 53 51 4c 0a 53 74 61 |with the| SQL.Sta|
|00000500| 6e 64 61 72 64 2e 20 54 | 68 65 20 6c 61 74 74 65 |ndard. T|he latte|
|00000510| 72 20 61 63 63 65 70 74 | 73 20 6f 6e 6c 79 20 74 |r accept|s only t|
|00000520| 61 62 6c 65 5f 72 65 66 | 65 72 65 6e 63 65 2c 20 |able_ref|erence, |
|00000530| 6e 6f 74 20 61 20 6c 69 | 73 74 20 6f 66 20 74 68 |not a li|st of th|
|00000540| 65 6d 0a 69 6e 73 69 64 | 65 20 61 20 70 61 69 72 |em.insid|e a pair|
|00000550| 20 6f 66 20 70 61 72 65 | 6e 74 68 65 73 65 73 2e | of pare|ntheses.|
|00000560| 0a 0a 54 68 69 73 20 69 | 73 20 61 20 63 6f 6e 73 |..This i|s a cons|
|00000570| 65 72 76 61 74 69 76 65 | 20 65 78 74 65 6e 73 69 |ervative| extensi|
|00000580| 6f 6e 20 69 66 20 77 65 | 20 63 6f 6e 73 69 64 65 |on if we| conside|
|00000590| 72 20 65 61 63 68 20 63 | 6f 6d 6d 61 20 69 6e 20 |r each c|omma in |
|000005a0| 61 20 6c 69 73 74 20 6f | 66 0a 74 61 62 6c 65 5f |a list o|f.table_|
|000005b0| 72 65 66 65 72 65 6e 63 | 65 20 69 74 65 6d 73 20 |referenc|e items |
|000005c0| 61 73 20 65 71 75 69 76 | 61 6c 65 6e 74 20 74 6f |as equiv|alent to|
|000005d0| 20 61 6e 20 69 6e 6e 65 | 72 20 6a 6f 69 6e 2e 20 | an inne|r join. |
|000005e0| 46 6f 72 20 65 78 61 6d | 70 6c 65 3a 0a 0a 53 45 |For exam|ple:..SE|
|000005f0| 4c 45 43 54 20 2a 20 46 | 52 4f 4d 20 74 31 20 4c |LECT * F|ROM t1 L|
|00000600| 45 46 54 20 4a 4f 49 4e | 20 28 74 32 2c 20 74 33 |EFT JOIN| (t2, t3|
|00000610| 2c 20 74 34 29 0a 20 20 | 20 20 20 20 20 20 20 20 |, t4). | |
|00000620| 20 20 20 20 20 20 20 4f | 4e 20 28 74 32 2e 61 3d | O|N (t2.a=|
|00000630| 74 31 2e 61 20 41 4e 44 | 20 74 33 2e 62 3d 74 31 |t1.a AND| t3.b=t1|
|00000640| 2e 62 20 41 4e 44 20 74 | 34 2e 63 3d 74 31 2e 63 |.b AND t|4.c=t1.c|
|00000650| 29 0a 0a 69 73 20 65 71 | 75 69 76 61 6c 65 6e 74 |)..is eq|uivalent|
|00000660| 20 74 6f 3a 0a 0a 53 45 | 4c 45 43 54 20 2a 20 46 | to:..SE|LECT * F|
|00000670| 52 4f 4d 20 74 31 20 4c | 45 46 54 20 4a 4f 49 4e |ROM t1 L|EFT JOIN|
|00000680| 20 28 74 32 20 43 52 4f | 53 53 20 4a 4f 49 4e 20 | (t2 CRO|SS JOIN |
|00000690| 74 33 20 43 52 4f 53 53 | 20 4a 4f 49 4e 20 74 34 |t3 CROSS| JOIN t4|
|000006a0| 29 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |). | |
|000006b0| 20 20 20 4f 4e 20 28 74 | 32 2e 61 3d 74 31 2e 61 | ON (t|2.a=t1.a|
|000006c0| 20 41 4e 44 20 74 33 2e | 62 3d 74 31 2e 62 20 41 | AND t3.|b=t1.b A|
|000006d0| 4e 44 20 74 34 2e 63 3d | 74 31 2e 63 29 0a 0a 49 |ND t4.c=|t1.c)..I|
|000006e0| 6e 20 4d 79 53 51 4c 2c | 20 43 52 4f 53 53 20 4a |n MySQL,| CROSS J|
|000006f0| 4f 49 4e 20 69 73 20 61 | 20 73 79 6e 74 61 63 74 |OIN is a| syntact|
|00000700| 69 63 20 65 71 75 69 76 | 61 6c 65 6e 74 20 74 6f |ic equiv|alent to|
|00000710| 20 49 4e 4e 45 52 20 4a | 4f 49 4e 20 28 74 68 65 | INNER J|OIN (the|
|00000720| 79 20 63 61 6e 0a 72 65 | 70 6c 61 63 65 20 65 61 |y can.re|place ea|
|00000730| 63 68 20 6f 74 68 65 72 | 29 2e 20 49 6e 20 73 74 |ch other|). In st|
|00000740| 61 6e 64 61 72 64 20 53 | 51 4c 2c 20 74 68 65 79 |andard S|QL, they|
|00000750| 20 61 72 65 20 6e 6f 74 | 20 65 71 75 69 76 61 6c | are not| equival|
|00000760| 65 6e 74 2e 20 49 4e 4e | 45 52 0a 4a 4f 49 4e 20 |ent. INN|ER.JOIN |
|00000770| 69 73 20 75 73 65 64 20 | 77 69 74 68 20 61 6e 20 |is used |with an |
|00000780| 4f 4e 20 63 6c 61 75 73 | 65 2c 20 43 52 4f 53 53 |ON claus|e, CROSS|
|00000790| 20 4a 4f 49 4e 20 69 73 | 20 75 73 65 64 20 6f 74 | JOIN is| used ot|
|000007a0| 68 65 72 77 69 73 65 2e | 0a 0a 49 6e 20 76 65 72 |herwise.|..In ver|
|000007b0| 73 69 6f 6e 73 20 6f 66 | 20 4d 79 53 51 4c 20 70 |sions of| MySQL p|
|000007c0| 72 69 6f 72 20 74 6f 20 | 35 2e 30 2e 31 2c 20 70 |rior to |5.0.1, p|
|000007d0| 61 72 65 6e 74 68 65 73 | 65 73 20 69 6e 20 74 61 |arenthes|es in ta|
|000007e0| 62 6c 65 5f 72 65 66 65 | 72 65 6e 63 65 73 0a 77 |ble_refe|rences.w|
|000007f0| 65 72 65 20 6a 75 73 74 | 20 6f 6d 69 74 74 65 64 |ere just| omitted|
|00000800| 20 61 6e 64 20 61 6c 6c | 20 6a 6f 69 6e 20 6f 70 | and all| join op|
|00000810| 65 72 61 74 69 6f 6e 73 | 20 77 65 72 65 20 67 72 |erations| were gr|
|00000820| 6f 75 70 65 64 20 74 6f | 20 74 68 65 20 6c 65 66 |ouped to| the lef|
|00000830| 74 2e 20 49 6e 0a 67 65 | 6e 65 72 61 6c 2c 20 70 |t. In.ge|neral, p|
|00000840| 61 72 65 6e 74 68 65 73 | 65 73 20 63 61 6e 20 62 |arenthes|es can b|
|00000850| 65 20 69 67 6e 6f 72 65 | 64 20 69 6e 20 6a 6f 69 |e ignore|d in joi|
|00000860| 6e 20 65 78 70 72 65 73 | 73 69 6f 6e 73 20 63 6f |n expres|sions co|
|00000870| 6e 74 61 69 6e 69 6e 67 | 20 6f 6e 6c 79 0a 69 6e |ntaining| only.in|
|00000880| 6e 65 72 20 6a 6f 69 6e | 20 6f 70 65 72 61 74 69 |ner join| operati|
|00000890| 6f 6e 73 2e 20 41 73 20 | 6f 66 20 35 2e 30 2e 31 |ons. As |of 5.0.1|
|000008a0| 2c 20 6e 65 73 74 65 64 | 20 6a 6f 69 6e 73 20 61 |, nested| joins a|
|000008b0| 72 65 20 61 6c 6c 6f 77 | 65 64 20 28 73 65 65 0a |re allow|ed (see.|
|000008c0| 68 74 74 70 3a 2f 2f 64 | 65 76 2e 6d 79 73 71 6c |http://d|ev.mysql|
|000008d0| 2e 63 6f 6d 2f 64 6f 63 | 2f 72 65 66 6d 61 6e 2f |.com/doc|/refman/|
|000008e0| 35 2e 30 2f 65 6e 2f 6e | 65 73 74 65 64 2d 6a 6f |5.0/en/n|ested-jo|
|000008f0| 69 6e 73 2e 68 74 6d 6c | 29 2e 0a 0a 46 75 72 74 |ins.html|)...Furt|
|00000900| 68 65 72 20 63 68 61 6e | 67 65 73 20 69 6e 20 6a |her chan|ges in j|
|00000910| 6f 69 6e 20 70 72 6f 63 | 65 73 73 69 6e 67 20 77 |oin proc|essing w|
|00000920| 65 72 65 20 6d 61 64 65 | 20 69 6e 20 35 2e 30 2e |ere made| in 5.0.|
|00000930| 31 32 20 74 6f 20 6d 61 | 6b 65 20 4d 79 53 51 4c |12 to ma|ke MySQL|
|00000940| 0a 6d 6f 72 65 20 63 6f | 6d 70 6c 69 61 6e 74 20 |.more co|mpliant |
|00000950| 77 69 74 68 20 73 74 61 | 6e 64 61 72 64 20 53 51 |with sta|ndard SQ|
|00000960| 4c 2e 20 54 68 65 73 65 | 20 63 68 61 72 67 65 73 |L. These| charges|
|00000970| 20 61 72 65 20 64 65 73 | 63 72 69 62 65 64 20 6c | are des|cribed l|
|00000980| 61 74 65 72 20 69 6e 0a | 74 68 69 73 20 73 65 63 |ater in.|this sec|
|00000990| 74 69 6f 6e 2e 0a 0a 49 | 6e 64 65 78 20 68 69 6e |tion...I|ndex hin|
|000009a0| 74 73 20 63 61 6e 20 62 | 65 20 73 70 65 63 69 66 |ts can b|e specif|
|000009b0| 69 65 64 20 74 6f 20 61 | 66 66 65 63 74 20 68 6f |ied to a|ffect ho|
|000009c0| 77 20 74 68 65 20 4d 79 | 53 51 4c 20 6f 70 74 69 |w the My|SQL opti|
|000009d0| 6d 69 7a 65 72 20 6d 61 | 6b 65 73 0a 75 73 65 20 |mizer ma|kes.use |
|000009e0| 6f 66 20 69 6e 64 65 78 | 65 73 2e 20 46 6f 72 20 |of index|es. For |
|000009f0| 6d 6f 72 65 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |more inf|ormation|
|00000a00| 2c 20 73 65 65 0a 68 74 | 74 70 3a 2f 2f 64 65 76 |, see.ht|tp://dev|
|00000a10| 2e 6d 79 73 71 6c 2e 63 | 6f 6d 2f 64 6f 63 2f 72 |.mysql.c|om/doc/r|
|00000a20| 65 66 6d 61 6e 2f 35 2e | 30 2f 65 6e 2f 69 6e 64 |efman/5.|0/en/ind|
|00000a30| 65 78 2d 68 69 6e 74 73 | 2e 68 74 6d 6c 2e 0a 0a |ex-hints|.html...|
|00000a40| 55 52 4c 3a 20 68 74 74 | 70 3a 2f 2f 64 65 76 2e |URL: htt|p://dev.|
|00000a50| 6d 79 73 71 6c 2e 63 6f | 6d 2f 64 6f 63 2f 72 65 |mysql.co|m/doc/re|
|00000a60| 66 6d 61 6e 2f 35 2e 30 | 2f 65 6e 2f 6a 6f 69 6e |fman/5.0|/en/join|
|00000a70| 2e 68 74 6d 6c 0a 0a 61 | 00 53 45 4c 45 43 54 20 |.html..a|.SELECT |
|00000a80| 74 61 62 6c 65 31 2e 2a | 20 46 52 4f 4d 20 74 61 |table1.*| FROM ta|
|00000a90| 62 6c 65 31 0a 20 20 4c | 45 46 54 20 4a 4f 49 4e |ble1. L|EFT JOIN|
|00000aa0| 20 74 61 62 6c 65 32 20 | 4f 4e 20 74 61 62 6c 65 | table2 |ON table|
|00000ab0| 31 2e 69 64 3d 74 61 62 | 6c 65 32 2e 69 64 0a 20 |1.id=tab|le2.id. |
|00000ac0| 20 57 48 45 52 45 20 74 | 61 62 6c 65 32 2e 69 64 | WHERE t|able2.id|
|00000ad0| 20 49 53 20 4e 55 4c 4c | 3b 0a 30 68 74 74 70 3a | IS NULL|;.0http:|
|00000ae0| 2f 2f 64 65 76 2e 6d 79 | 73 71 6c 2e 63 6f 6d 2f |//dev.my|sql.com/|
|00000af0| 64 6f 63 2f 72 65 66 6d | 61 6e 2f 35 2e 30 2f 65 |doc/refm|an/5.0/e|
|00000b00| 6e 2f 6a 6f 69 6e 2e 68 | 74 6d 6c 00 01 02 59 22 |n/join.h|tml...Y"|
|00000b10| 01 00 00 00 03 48 45 58 | 21 00 90 01 53 79 6e 74 |.....HEX|!...Synt|
|00000b20| 61 78 3a 0a 48 45 58 28 | 4e 5f 6f 72 5f 53 29 0a |ax:.HEX(|N_or_S).|
|00000b30| 0a 49 66 20 4e 5f 6f 72 | 5f 53 20 69 73 20 61 20 |.If N_or|_S is a |
|00000b40| 6e 75 6d 62 65 72 2c 20 | 72 65 74 75 72 6e 73 20 |number, |returns |
|00000b50| 61 20 73 74 72 69 6e 67 | 20 72 65 70 72 65 73 65 |a string| represe|
|00000b60| 6e 74 61 74 69 6f 6e 20 | 6f 66 20 74 68 65 0a 68 |ntation |of the.h|
|00000b70| 65 78 61 64 65 63 69 6d | 61 6c 20 76 61 6c 75 65 |exadecim|al value|
|00000b80| 20 6f 66 20 4e 2c 20 77 | 68 65 72 65 20 4e 20 69 | of N, w|here N i|
|00000b90| 73 20 61 20 6c 6f 6e 67 | 6c 6f 6e 67 20 28 42 49 |s a long|long (BI|
|00000ba0| 47 49 4e 54 29 20 6e 75 | 6d 62 65 72 2e 20 54 68 |GINT) nu|mber. Th|
|00000bb0| 69 73 20 69 73 0a 65 71 | 75 69 76 61 6c 65 6e 74 |is is.eq|uivalent|
|00000bc0| 20 74 6f 20 43 4f 4e 56 | 28 4e 2c 31 30 2c 31 36 | to CONV|(N,10,16|
|00000bd0| 29 2e 0a 0a 49 66 20 4e | 5f 6f 72 5f 53 20 69 73 |)...If N|_or_S is|
|00000be0| 20 61 20 73 74 72 69 6e | 67 2c 20 72 65 74 75 72 | a strin|g, retur|
|00000bf0| 6e 73 20 61 20 68 65 78 | 61 64 65 63 69 6d 61 6c |ns a hex|adecimal|
|00000c00| 20 73 74 72 69 6e 67 20 | 72 65 70 72 65 73 65 6e | string |represen|
|00000c10| 74 61 74 69 6f 6e 20 6f | 66 0a 4e 5f 6f 72 5f 53 |tation o|f.N_or_S|
|00000c20| 20 77 68 65 72 65 20 65 | 61 63 68 20 63 68 61 72 | where e|ach char|
|00000c30| 61 63 74 65 72 20 69 6e | 20 4e 5f 6f 72 5f 53 20 |acter in| N_or_S |
|00000c40| 69 73 20 63 6f 6e 76 65 | 72 74 65 64 20 74 6f 20 |is conve|rted to |
|00000c50| 74 77 6f 20 68 65 78 61 | 64 65 63 69 6d 61 6c 0a |two hexa|decimal.|
|00000c60| 64 69 67 69 74 73 2e 0a | 0a 55 52 4c 3a 20 68 74 |digits..|.URL: ht|
|00000c70| 74 70 3a 2f 2f 64 65 76 | 2e 6d 79 73 71 6c 2e 63 |tp://dev|.mysql.c|
|00000c80| 6f 6d 2f 64 6f 63 2f 72 | 65 66 6d 61 6e 2f 35 2e |om/doc/r|efman/5.|
|00000c90| 30 2f 65 6e 2f 73 74 72 | 69 6e 67 2d 66 75 6e 63 |0/en/str|ing-func|
|00000ca0| 74 69 6f 6e 73 2e 68 74 | 6d 6c 0a 0a 7d 00 6d 79 |tions.ht|ml..}.my|
|00000cb0| 73 71 6c 3e 20 53 45 4c | 45 43 54 20 48 45 58 28 |sql> SEL|ECT HEX(|
|00000cc0| 32 35 35 29 3b 0a 20 20 | 20 20 20 20 20 20 2d 3e |255);. | ->|
|00000cd0| 20 27 46 46 27 0a 6d 79 | 73 71 6c 3e 20 53 45 4c | 'FF'.my|sql> SEL|
|00000ce0| 45 43 54 20 30 78 36 31 | 36 32 36 33 3b 0a 20 20 |ECT 0x61|6263;. |
|00000cf0| 20 20 20 20 20 20 2d 3e | 20 27 61 62 63 27 0a 6d | ->| 'abc'.m|
|00000d00| 79 73 71 6c 3e 20 53 45 | 4c 45 43 54 20 48 45 58 |ysql> SE|LECT HEX|
|00000d10| 28 27 61 62 63 27 29 3b | 0a 20 20 20 20 20 20 20 |('abc');|. |
|00000d20| 20 2d 3e 20 36 31 36 32 | 36 33 0a 3c 68 74 74 70 | -> 6162|63.<http|
|00000d30| 3a 2f 2f 64 65 76 2e 6d | 79 73 71 6c 2e 63 6f 6d |://dev.m|ysql.com|
|00000d40| 2f 64 6f 63 2f 72 65 66 | 6d 61 6e 2f 35 2e 30 2f |/doc/ref|man/5.0/|
|00000d50| 65 6e 2f 73 74 72 69 6e | 67 2d 66 75 6e 63 74 69 |en/strin|g-functi|
|00000d60| 6f 6e 73 2e 68 74 6d 6c | 03 01 b4 00 22 02 00 00 |ons.html|...."...|
|00000d70| 00 07 52 45 50 4c 41 43 | 45 21 00 13 01 53 79 6e |..REPLAC|E!...Syn|
|00000d80| 74 61 78 3a 0a 52 45 50 | 4c 41 43 45 28 73 74 72 |tax:.REP|LACE(str|
|00000d90| 2c 66 72 6f 6d 5f 73 74 | 72 2c 74 6f 5f 73 74 72 |,from_st|r,to_str|
|00000da0| 29 0a 0a 52 65 74 75 72 | 6e 73 20 74 68 65 20 73 |)..Retur|ns the s|
|00000db0| 74 72 69 6e 67 20 73 74 | 72 20 77 69 74 68 20 61 |tring st|r with a|
|00000dc0| 6c 6c 20 6f 63 63 75 72 | 72 65 6e 63 65 73 20 6f |ll occur|rences o|
|00000dd0| 66 20 74 68 65 20 73 74 | 72 69 6e 67 20 66 72 6f |f the st|ring fro|
|00000de0| 6d 5f 73 74 72 0a 72 65 | 70 6c 61 63 65 64 20 62 |m_str.re|placed b|
|00000df0| 79 20 74 68 65 20 73 74 | 72 69 6e 67 20 74 6f 5f |y the st|ring to_|
|00000e00| 73 74 72 2e 20 52 45 50 | 4c 41 43 45 28 29 20 70 |str. REP|LACE() p|
|00000e10| 65 72 66 6f 72 6d 73 20 | 61 20 63 61 73 65 2d 73 |erforms |a case-s|
|00000e20| 65 6e 73 69 74 69 76 65 | 0a 6d 61 74 63 68 20 77 |ensitive|.match w|
|00000e30| 68 65 6e 20 73 65 61 72 | 63 68 69 6e 67 20 66 6f |hen sear|ching fo|
|00000e40| 72 20 66 72 6f 6d 5f 73 | 74 72 2e 0a 0a 55 52 4c |r from_s|tr...URL|
|00000e50| 3a 20 68 74 74 70 3a 2f | 2f 64 65 76 2e 6d 79 73 |: http:/|/dev.mys|
|00000e60| 71 6c 2e 63 6f 6d 2f 64 | 6f 63 2f 72 65 66 6d 61 |ql.com/d|oc/refma|
|00000e70| 6e 2f 35 2e 30 2f 65 6e | 2f 73 74 72 69 6e 67 2d |n/5.0/en|/string-|
|00000e80| 66 75 6e 63 74 69 6f 6e | 73 2e 68 74 6d 6c 0a 0a |function|s.html..|
|00000e90| 51 00 6d 79 73 71 6c 3e | 20 53 45 4c 45 43 54 20 |Q.mysql>| SELECT |
|00000ea0| 52 45 50 4c 41 43 45 28 | 27 77 77 77 2e 6d 79 73 |REPLACE(|'www.mys|
|00000eb0| 71 6c 2e 63 6f 6d 27 2c | 20 27 77 27 2c 20 27 57 |ql.com',| 'w', 'W|
|00000ec0| 77 27 29 3b 0a 20 20 20 | 20 20 20 20 20 2d 3e 20 |w');. | -> |
|00000ed0| 27 57 77 57 77 57 77 2e | 6d 79 73 71 6c 2e 63 6f |'WwWwWw.|mysql.co|
|00000ee0| 6d 27 0a 3c 68 74 74 70 | 3a 2f 2f 64 65 76 2e 6d |m'.<http|://dev.m|
|00000ef0| 79 73 71 6c 2e 63 6f 6d | 2f 64 6f 63 2f 72 65 66 |ysql.com|/doc/ref|
|00000f00| 6d 61 6e 2f 35 2e 30 2f | 65 6e 2f 73 74 72 69 6e |man/5.0/|en/strin|
|00000f10| 67 2d 66 75 6e 63 74 69 | 6f 6e 73 2e 68 74 6d 6c |g-functi|ons.html|
|00000f20| 03 01 6c 00 32 03 00 00 | 00 08 43 4f 4e 54 41 49 |..l.2...|..CONTAI|
|00000f30| 4e 53 1a 00 f1 00 43 6f | 6e 74 61 69 6e 73 28 67 |NS....Co|ntains(g|
|00000f40| 31 2c 67 32 29 0a 0a 52 | 65 74 75 72 6e 73 20 31 |1,g2)..R|eturns 1|
|00000f50| 20 6f 72 20 30 20 74 6f | 20 69 6e 64 69 63 61 74 | or 0 to| indicat|
|00000f60| 65 20 77 68 65 74 68 65 | 72 20 67 31 20 63 6f 6d |e whethe|r g1 com|
|00000f70| 70 6c 65 74 65 6c 79 20 | 63 6f 6e 74 61 69 6e 73 |pletely |contains|
|00000f80| 20 67 32 2e 20 54 68 69 | 73 0a 74 65 73 74 73 20 | g2. Thi|s.tests |
|00000f90| 74 68 65 20 6f 70 70 6f | 73 69 74 65 20 72 65 6c |the oppo|site rel|
|00000fa0| 61 74 69 6f 6e 73 68 69 | 70 20 61 73 20 57 69 74 |ationshi|p as Wit|
|00000fb0| 68 69 6e 28 29 2e 0a 0a | 55 52 4c 3a 20 68 74 74 |hin()...|URL: htt|
|00000fc0| 70 3a 2f 2f 64 65 76 2e | 6d 79 73 71 6c 2e 63 6f |p://dev.|mysql.co|
|00000fd0| 6d 2f 64 6f 63 2f 72 65 | 66 6d 61 6e 2f 35 2e 30 |m/doc/re|fman/5.0|
|00000fe0| 2f 65 6e 2f 66 75 6e 63 | 74 69 6f 6e 73 2d 74 68 |/en/func|tions-th|
|00000ff0| 61 74 2d 74 65 73 74 2d | 73 70 61 74 69 61 6c 2d |at-test-|spatial-|
|00001000| 72 65 6c 61 74 69 6f 6e | 73 68 69 70 73 2d 62 65 |relation|ships-be|
|00001010| 74 77 65 65 6e 2d 67 65 | 6f 6d 65 74 72 69 65 73 |tween-ge|ometries|
|00001020| 2e 68 74 6d 6c 0a 0a 68 | 68 74 74 70 3a 2f 2f 64 |.html..h|http://d|
|00001030| 65 76 2e 6d 79 73 71 6c | 2e 63 6f 6d 2f 64 6f 63 |ev.mysql|.com/doc|
|00001040| 2f 72 65 66 6d 61 6e 2f | 35 2e 30 2f 65 6e 2f 66 |/refman/|5.0/en/f|
|00001050| 75 6e 63 74 69 6f 6e 73 | 2d 74 68 61 74 2d 74 65 |unctions|-that-te|
|00001060| 73 74 2d 73 70 61 74 69 | 61 6c 2d 72 65 6c 61 74 |st-spati|al-relat|
|00001070| 69 6f 6e 73 68 69 70 73 | 2d 62 65 74 77 65 65 6e |ionships|-between|
|00001080| 2d 67 65 6f 6d 65 74 72 | 69 65 73 2e 68 74 6d 6c |-geometr|ies.html|
|00001090| 03 02 e0 00 22 04 00 00 | 00 04 53 52 49 44 20 00 |...."...|..SRID .|
|000010a0| 49 01 53 52 49 44 28 67 | 29 0a 0a 52 65 74 75 72 |I.SRID(g|)..Retur|
|000010b0| 6e 73 20 61 6e 20 69 6e | 74 65 67 65 72 20 69 6e |ns an in|teger in|
|000010c0| 64 69 63 61 74 69 6e 67 | 20 74 68 65 20 53 70 61 |dicating| the Spa|
|000010d0| 74 69 61 6c 20 52 65 66 | 65 72 65 6e 63 65 20 53 |tial Ref|erence S|
|000010e0| 79 73 74 65 6d 20 49 44 | 20 66 6f 72 20 74 68 65 |ystem ID| for the|
|000010f0| 0a 67 65 6f 6d 65 74 72 | 79 20 76 61 6c 75 65 20 |.geometr|y value |
|00001100| 67 2e 0a 0a 49 6e 20 4d | 79 53 51 4c 2c 20 74 68 |g...In M|ySQL, th|
|00001110| 65 20 53 52 49 44 20 76 | 61 6c 75 65 20 69 73 20 |e SRID v|alue is |
|00001120| 6a 75 73 74 20 61 6e 20 | 69 6e 74 65 67 65 72 20 |just an |integer |
|00001130| 61 73 73 6f 63 69 61 74 | 65 64 20 77 69 74 68 20 |associat|ed with |
|00001140| 74 68 65 0a 67 65 6f 6d | 65 74 72 79 20 76 61 6c |the.geom|etry val|
|00001150| 75 65 2e 20 41 6c 6c 20 | 63 61 6c 63 75 6c 61 74 |ue. All |calculat|
|00001160| 69 6f 6e 73 20 61 72 65 | 20 64 6f 6e 65 20 61 73 |ions are| done as|
|00001170| 73 75 6d 69 6e 67 20 45 | 75 63 6c 69 64 65 61 6e |suming E|uclidean|
|00001180| 20 28 70 6c 61 6e 61 72 | 29 0a 67 65 6f 6d 65 74 | (planar|).geomet|
|00001190| 72 79 2e 0a 0a 55 52 4c | 3a 20 68 74 74 70 3a 2f |ry...URL|: http:/|
|000011a0| 2f 64 65 76 2e 6d 79 73 | 71 6c 2e 63 6f 6d 2f 64 |/dev.mys|ql.com/d|
|000011b0| 6f 63 2f 72 65 66 6d 61 | 6e 2f 35 2e 30 2f 65 6e |oc/refma|n/5.0/en|
|000011c0| 2f 67 65 6e 65 72 61 6c | 2d 67 65 6f 6d 65 74 72 |/general|-geometr|
|000011d0| 79 2d 70 72 6f 70 65 72 | 74 79 2d 66 75 6e 63 74 |y-proper|ty-funct|
|000011e0| 69 6f 6e 73 2e 68 74 6d | 6c 0a 0a 37 01 6d 79 73 |ions.htm|l..7.mys|
|000011f0| 71 6c 3e 20 53 45 4c 45 | 43 54 20 53 52 49 44 28 |ql> SELE|CT SRID(|
|00001200| 47 65 6f 6d 46 72 6f 6d | 54 65 78 74 28 27 4c 69 |GeomFrom|Text('Li|
|00001210| 6e 65 53 74 72 69 6e 67 | 28 31 20 31 2c 32 20 32 |neString|(1 1,2 2|
|00001220| 29 27 2c 31 30 31 29 29 | 3b 0a 2b 2d 2d 2d 2d 2d |)',101))|;.+-----|
|00001230| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001240| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001250| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2b 0a 7c 20 53 52 |--------|--+.| SR|
|00001260| 49 44 28 47 65 6f 6d 46 | 72 6f 6d 54 65 78 74 28 |ID(GeomF|romText(|
|00001270| 27 4c 69 6e 65 53 74 72 | 69 6e 67 28 31 20 31 2c |'LineStr|ing(1 1,|
|00001280| 32 20 32 29 27 2c 31 30 | 31 29 29 20 7c 0a 2b 2d |2 2)',10|1)) |.+-|
|00001290| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000012a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000012b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2b 0a |--------|------+.|
|000012c0| 7c 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 || | |
|000012d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000012e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 31 30 31 20 | | 101 |
|000012f0| 7c 0a 2b 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d ||.+-----|--------|
|00001300| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001310| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001320| 2d 2d 2b 0a 4f 68 74 74 | 70 3a 2f 2f 64 65 76 2e |--+.Ohtt|p://dev.|
|00001330| 6d 79 73 71 6c 2e 63 6f | 6d 2f 64 6f 63 2f 72 65 |mysql.co|m/doc/re|
|00001340| 66 6d 61 6e 2f 35 2e 30 | 2f 65 6e 2f 67 65 6e 65 |fman/5.0|/en/gene|
|00001350| 72 61 6c 2d 67 65 6f 6d | 65 74 72 79 2d 70 72 6f |ral-geom|etry-pro|
|00001360| 70 65 72 74 79 2d 66 75 | 6e 63 74 69 6f 6e 73 2e |perty-fu|nctions.|
|00001370| 68 74 6d 6c 03 01 1c 00 | 32 05 00 00 00 11 43 55 |html....|2.....CU|
|00001380| 52 52 45 4e 54 5f 54 49 | 4d 45 53 54 41 4d 50 1c |RRENT_TI|MESTAMP.|
|00001390| 00 bd 00 53 79 6e 74 61 | 78 3a 0a 43 55 52 52 45 |...Synta|x:.CURRE|
|000013a0| 4e 54 5f 54 49 4d 45 53 | 54 41 4d 50 2c 20 43 55 |NT_TIMES|TAMP, CU|
|000013b0| 52 52 45 4e 54 5f 54 49 | 4d 45 53 54 41 4d 50 28 |RRENT_TI|MESTAMP(|
|000013c0| 29 0a 0a 43 55 52 52 45 | 4e 54 5f 54 49 4d 45 53 |)..CURRE|NT_TIMES|
|000013d0| 54 41 4d 50 20 61 6e 64 | 20 43 55 52 52 45 4e 54 |TAMP and| CURRENT|
|000013e0| 5f 54 49 4d 45 53 54 41 | 4d 50 28 29 20 61 72 65 |_TIMESTA|MP() are|
|000013f0| 20 73 79 6e 6f 6e 79 6d | 73 20 66 6f 72 20 4e 4f | synonym|s for NO|
|00001400| 57 28 29 2e 0a 0a 55 52 | 4c 3a 20 68 74 74 70 3a |W()...UR|L: http:|
|00001410| 2f 2f 64 65 76 2e 6d 79 | 73 71 6c 2e 63 6f 6d 2f |//dev.my|sql.com/|
|00001420| 64 6f 63 2f 72 65 66 6d | 61 6e 2f 35 2e 30 2f 65 |doc/refm|an/5.0/e|
|00001430| 6e 2f 64 61 74 65 2d 61 | 6e 64 2d 74 69 6d 65 2d |n/date-a|nd-time-|
|00001440| 66 75 6e 63 74 69 6f 6e | 73 2e 68 74 6d 6c 0a 0a |function|s.html..|
|00001450| 43 68 74 74 70 3a 2f 2f | 64 65 76 2e 6d 79 73 71 |Chttp://|dev.mysq|
|00001460| 6c 2e 63 6f 6d 2f 64 6f | 63 2f 72 65 66 6d 61 6e |l.com/do|c/refman|
|00001470| 2f 35 2e 30 2f 65 6e 2f | 64 61 74 65 2d 61 6e 64 |/5.0/en/|date-and|
|00001480| 2d 74 69 6d 65 2d 66 75 | 6e 63 74 69 6f 6e 73 2e |-time-fu|nctions.|
|00001490| 68 74 6d 6c 03 01 8c 00 | 32 06 00 00 00 08 56 41 |html....|2.....VA|
|000014a0| 52 49 41 4e 43 45 0e 00 | 3b 01 53 79 6e 74 61 78 |RIANCE..|;.Syntax|
|000014b0| 3a 0a 56 41 52 49 41 4e | 43 45 28 65 78 70 72 29 |:.VARIAN|CE(expr)|
|000014c0| 0a 0a 52 65 74 75 72 6e | 73 20 74 68 65 20 70 6f |..Return|s the po|
|000014d0| 70 75 6c 61 74 69 6f 6e | 20 73 74 61 6e 64 61 72 |pulation| standar|
|000014e0| 64 20 76 61 72 69 61 6e | 63 65 20 6f 66 20 65 78 |d varian|ce of ex|
|000014f0| 70 72 2e 20 54 68 69 73 | 20 69 73 20 61 6e 20 65 |pr. This| is an e|
|00001500| 78 74 65 6e 73 69 6f 6e | 0a 74 6f 20 73 74 61 6e |xtension|.to stan|
|00001510| 64 61 72 64 20 53 51 4c | 2e 20 41 73 20 6f 66 20 |dard SQL|. As of |
|00001520| 4d 79 53 51 4c 20 35 2e | 30 2e 33 2c 20 74 68 65 |MySQL 5.|0.3, the|
|00001530| 20 73 74 61 6e 64 61 72 | 64 20 53 51 4c 20 66 75 | standar|d SQL fu|
|00001540| 6e 63 74 69 6f 6e 20 56 | 41 52 5f 50 4f 50 28 29 |nction V|AR_POP()|
|00001550| 0a 63 61 6e 20 62 65 20 | 75 73 65 64 20 69 6e 73 |.can be |used ins|
|00001560| 74 65 61 64 2e 0a 0a 56 | 41 52 49 41 4e 43 45 28 |tead...V|ARIANCE(|
|00001570| 29 20 72 65 74 75 72 6e | 73 20 4e 55 4c 4c 20 69 |) return|s NULL i|
|00001580| 66 20 74 68 65 72 65 20 | 77 65 72 65 20 6e 6f 20 |f there |were no |
|00001590| 6d 61 74 63 68 69 6e 67 | 20 72 6f 77 73 2e 0a 0a |matching| rows...|
|000015a0| 55 52 4c 3a 20 68 74 74 | 70 3a 2f 2f 64 65 76 2e |URL: htt|p://dev.|
|000015b0| 6d 79 73 71 6c 2e 63 6f | 6d 2f 64 6f 63 2f 72 65 |mysql.co|m/doc/re|
|000015c0| 66 6d 61 6e 2f 35 2e 30 | 2f 65 6e 2f 67 72 6f 75 |fman/5.0|/en/grou|
|000015d0| 70 2d 62 79 2d 66 75 6e | 63 74 69 6f 6e 73 2e 68 |p-by-fun|ctions.h|
|000015e0| 74 6d 6c 0a 0a 3e 68 74 | 74 70 3a 2f 2f 64 65 76 |tml..>ht|tp://dev|
|000015f0| 2e 6d 79 73 71 6c 2e 63 | 6f 6d 2f 64 6f 63 2f 72 |.mysql.c|om/doc/r|
|00001600| 65 66 6d 61 6e 2f 35 2e | 30 2f 65 6e 2f 67 72 6f |efman/5.|0/en/gro|
|00001610| 75 70 2d 62 79 2d 66 75 | 6e 63 74 69 6f 6e 73 2e |up-by-fu|nctions.|
|00001620| 68 74 6d 6c 03 01 6f 01 | 32 07 00 00 00 08 56 41 |html..o.|2.....VA|
|00001630| 52 5f 53 41 4d 50 0e 00 | 1e 01 53 79 6e 74 61 78 |R_SAMP..|..Syntax|
|00001640| 3a 0a 56 41 52 5f 53 41 | 4d 50 28 65 78 70 72 29 |:.VAR_SA|MP(expr)|
|00001650| 0a 0a 52 65 74 75 72 6e | 73 20 74 68 65 20 73 61 |..Return|s the sa|
|00001660| 6d 70 6c 65 20 76 61 72 | 69 61 6e 63 65 20 6f 66 |mple var|iance of|
|00001670| 20 65 78 70 72 2e 20 54 | 68 61 74 20 69 73 2c 20 | expr. T|hat is, |
|00001680| 74 68 65 20 64 65 6e 6f | 6d 69 6e 61 74 6f 72 20 |the deno|minator |
|00001690| 69 73 20 74 68 65 0a 6e | 75 6d 62 65 72 20 6f 66 |is the.n|umber of|
|000016a0| 20 72 6f 77 73 20 6d 69 | 6e 75 73 20 6f 6e 65 2e | rows mi|nus one.|
|000016b0| 20 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 77 | This fu|nction w|
|000016c0| 61 73 20 61 64 64 65 64 | 20 69 6e 20 4d 79 53 51 |as added| in MySQ|
|000016d0| 4c 20 35 2e 30 2e 33 2e | 0a 0a 56 41 52 5f 53 41 |L 5.0.3.|..VAR_SA|
|000016e0| 4d 50 28 29 20 72 65 74 | 75 72 6e 73 20 4e 55 4c |MP() ret|urns NUL|
|000016f0| 4c 20 69 66 20 74 68 65 | 72 65 20 77 65 72 65 20 |L if the|re were |
|00001700| 6e 6f 20 6d 61 74 63 68 | 69 6e 67 20 72 6f 77 73 |no match|ing rows|
|00001710| 2e 0a 0a 55 52 4c 3a 20 | 68 74 74 70 3a 2f 2f 64 |...URL: |http://d|
|00001720| 65 76 2e 6d 79 73 71 6c | 2e 63 6f 6d 2f 64 6f 63 |ev.mysql|.com/doc|
|00001730| 2f 72 65 66 6d 61 6e 2f | 35 2e 30 2f 65 6e 2f 67 |/refman/|5.0/en/g|
|00001740| 72 6f 75 70 2d 62 79 2d | 66 75 6e 63 74 69 6f 6e |roup-by-|function|
|00001750| 73 2e 68 74 6d 6c 0a 0a | 3e 68 74 74 70 3a 2f 2f |s.html..|>http://|
|00001760| 64 65 76 2e 6d 79 73 71 | 6c 2e 63 6f 6d 2f 64 6f |dev.mysq|l.com/do|
|00001770| 63 2f 72 65 66 6d 61 6e | 2f 35 2e 30 2f 65 6e 2f |c/refman|/5.0/en/|
|00001780| 67 72 6f 75 70 2d 62 79 | 2d 66 75 6e 63 74 69 6f |group-by|-functio|
|00001790| 6e 73 2e 68 74 6d 6c 00 | 01 03 45 22 08 00 00 00 |ns.html.|..E"....|
|000017a0| 06 43 4f 4e 43 41 54 21 | 00 56 02 53 79 6e 74 61 |.CONCAT!|.V.Synta|
|000017b0| 78 3a 0a 43 4f 4e 43 41 | 54 28 73 74 72 31 2c 73 |x:.CONCA|T(str1,s|
|000017c0| 74 72 32 2c 2e 2e 2e 29 | 0a 0a 52 65 74 75 72 6e |tr2,...)|..Return|
|000017d0| 73 20 74 68 65 20 73 74 | 72 69 6e 67 20 74 68 61 |s the st|ring tha|
|000017e0| 74 20 72 65 73 75 6c 74 | 73 20 66 72 6f 6d 20 63 |t result|s from c|
|000017f0| 6f 6e 63 61 74 65 6e 61 | 74 69 6e 67 20 74 68 65 |oncatena|ting the|
|00001800| 20 61 72 67 75 6d 65 6e | 74 73 2e 20 4d 61 79 0a | argumen|ts. May.|
|00001810| 68 61 76 65 20 6f 6e 65 | 20 6f 72 20 6d 6f 72 65 |have one| or more|
|00001820| 20 61 72 67 75 6d 65 6e | 74 73 2e 20 49 66 20 61 | argumen|ts. If a|
|00001830| 6c 6c 20 61 72 67 75 6d | 65 6e 74 73 20 61 72 65 |ll argum|ents are|
|00001840| 20 6e 6f 6e 2d 62 69 6e | 61 72 79 20 73 74 72 69 | non-bin|ary stri|
|00001850| 6e 67 73 2c 0a 74 68 65 | 20 72 65 73 75 6c 74 20 |ngs,.the| result |
|00001860| 69 73 20 61 20 6e 6f 6e | 2d 62 69 6e 61 72 79 20 |is a non|-binary |
|00001870| 73 74 72 69 6e 67 2e 20 | 49 66 20 74 68 65 20 61 |string. |If the a|
|00001880| 72 67 75 6d 65 6e 74 73 | 20 69 6e 63 6c 75 64 65 |rguments| include|
|00001890| 20 61 6e 79 20 62 69 6e | 61 72 79 0a 73 74 72 69 | any bin|ary.stri|
|000018a0| 6e 67 73 2c 20 74 68 65 | 20 72 65 73 75 6c 74 20 |ngs, the| result |
|000018b0| 69 73 20 61 20 62 69 6e | 61 72 79 20 73 74 72 69 |is a bin|ary stri|
|000018c0| 6e 67 2e 20 41 20 6e 75 | 6d 65 72 69 63 20 61 72 |ng. A nu|meric ar|
|000018d0| 67 75 6d 65 6e 74 20 69 | 73 20 63 6f 6e 76 65 72 |gument i|s conver|
|000018e0| 74 65 64 0a 74 6f 20 69 | 74 73 20 65 71 75 69 76 |ted.to i|ts equiv|
|000018f0| 61 6c 65 6e 74 20 62 69 | 6e 61 72 79 20 73 74 72 |alent bi|nary str|
|00001900| 69 6e 67 20 66 6f 72 6d | 3b 20 69 66 20 79 6f 75 |ing form|; if you|
|00001910| 20 77 61 6e 74 20 74 6f | 20 61 76 6f 69 64 20 74 | want to| avoid t|
|00001920| 68 61 74 2c 20 79 6f 75 | 0a 63 61 6e 20 75 73 65 |hat, you|.can use|
|00001930| 20 61 6e 20 65 78 70 6c | 69 63 69 74 20 74 79 70 | an expl|icit typ|
|00001940| 65 20 63 61 73 74 2c 20 | 61 73 20 69 6e 20 74 68 |e cast, |as in th|
|00001950| 69 73 20 65 78 61 6d 70 | 6c 65 3a 0a 0a 53 45 4c |is examp|le:..SEL|
|00001960| 45 43 54 20 43 4f 4e 43 | 41 54 28 43 41 53 54 28 |ECT CONC|AT(CAST(|
|00001970| 69 6e 74 5f 63 6f 6c 20 | 41 53 20 43 48 41 52 29 |int_col |AS CHAR)|
|00001980| 2c 20 63 68 61 72 5f 63 | 6f 6c 29 3b 0a 0a 43 4f |, char_c|ol);..CO|
|00001990| 4e 43 41 54 28 29 20 72 | 65 74 75 72 6e 73 20 4e |NCAT() r|eturns N|
|000019a0| 55 4c 4c 20 69 66 20 61 | 6e 79 20 61 72 67 75 6d |ULL if a|ny argum|
|000019b0| 65 6e 74 20 69 73 20 4e | 55 4c 4c 2e 0a 0a 55 52 |ent is N|ULL...UR|
|000019c0| 4c 3a 20 68 74 74 70 3a | 2f 2f 64 65 76 2e 6d 79 |L: http:|//dev.my|
|000019d0| 73 71 6c 2e 63 6f 6d 2f | 64 6f 63 2f 72 65 66 6d |sql.com/|doc/refm|
|000019e0| 61 6e 2f 35 2e 30 2f 65 | 6e 2f 73 74 72 69 6e 67 |an/5.0/e|n/string|
|000019f0| 2d 66 75 6e 63 74 69 6f | 6e 73 2e 68 74 6d 6c 0a |-functio|ns.html.|
|00001a00| 0a a0 00 6d 79 73 71 6c | 3e 20 53 45 4c 45 43 54 |...mysql|> SELECT|
|00001a10| 20 43 4f 4e 43 41 54 28 | 27 4d 79 27 2c 20 27 53 | CONCAT(|'My', 'S|
|00001a20| 27 2c 20 27 51 4c 27 29 | 3b 0a 20 20 20 20 20 20 |', 'QL')|;. |
|00001a30| 20 20 2d 3e 20 27 4d 79 | 53 51 4c 27 0a 6d 79 73 | -> 'My|SQL'.mys|
|00001a40| 71 6c 3e 20 53 45 4c 45 | 43 54 20 43 4f 4e 43 41 |ql> SELE|CT CONCA|
|00001a50| 54 28 27 4d 79 27 2c 20 | 4e 55 4c 4c 2c 20 27 51 |T('My', |NULL, 'Q|
|00001a60| 4c 27 29 3b 0a 20 20 20 | 20 20 20 20 20 2d 3e 20 |L');. | -> |
|00001a70| 4e 55 4c 4c 0a 6d 79 73 | 71 6c 3e 20 53 45 4c 45 |NULL.mys|ql> SELE|
|00001a80| 43 54 20 43 4f 4e 43 41 | 54 28 31 34 2e 33 29 3b |CT CONCA|T(14.3);|
|00001a90| 0a 20 20 20 20 20 20 20 | 20 2d 3e 20 27 31 34 2e |. | -> '14.|
|00001aa0| 33 27 0a 3c 68 74 74 70 | 3a 2f 2f 64 65 76 2e 6d |3'.<http|://dev.m|
|00001ab0| 79 73 71 6c 2e 63 6f 6d | 2f 64 6f 63 2f 72 65 66 |ysql.com|/doc/ref|
|00001ac0| 6d 61 6e 2f 35 2e 30 2f | 65 6e 2f 73 74 72 69 6e |man/5.0/|en/strin|
|00001ad0| 67 2d 66 75 6e 63 74 69 | 6f 6e 73 2e 68 74 6d 6c |g-functi|ons.html|
|00001ae0| 03 06 46 02 32 09 00 00 | 00 12 47 45 4f 4d 45 54 |..F.2...|..GEOMET|
|00001af0| 52 59 20 48 49 45 52 41 | 52 43 48 59 1e 00 e1 05 |RY HIERA|RCHY....|
|00001b00| 47 65 6f 6d 65 74 72 79 | 20 69 73 20 74 68 65 20 |Geometry| is the |
|00001b10| 62 61 73 65 20 63 6c 61 | 73 73 2e 20 49 74 20 69 |base cla|ss. It i|
|00001b20| 73 20 61 6e 20 61 62 73 | 74 72 61 63 74 20 63 6c |s an abs|tract cl|
|00001b30| 61 73 73 2e 20 54 68 65 | 20 69 6e 73 74 61 6e 74 |ass. The| instant|
|00001b40| 69 61 62 6c 65 0a 73 75 | 62 63 6c 61 73 73 65 73 |iable.su|bclasses|
|00001b50| 20 6f 66 20 47 65 6f 6d | 65 74 72 79 20 61 72 65 | of Geom|etry are|
|00001b60| 20 72 65 73 74 72 69 63 | 74 65 64 20 74 6f 20 7a | restric|ted to z|
|00001b70| 65 72 6f 2d 2c 20 6f 6e | 65 2d 2c 20 61 6e 64 0a |ero-, on|e-, and.|
|00001b80| 74 77 6f 2d 64 69 6d 65 | 6e 73 69 6f 6e 61 6c 20 |two-dime|nsional |
|00001b90| 67 65 6f 6d 65 74 72 69 | 63 20 6f 62 6a 65 63 74 |geometri|c object|
|00001ba0| 73 20 74 68 61 74 20 65 | 78 69 73 74 20 69 6e 20 |s that e|xist in |
|00001bb0| 74 77 6f 2d 64 69 6d 65 | 6e 73 69 6f 6e 61 6c 0a |two-dime|nsional.|
|00001bc0| 63 6f 6f 72 64 69 6e 61 | 74 65 20 73 70 61 63 65 |coordina|te space|
|00001bd0| 2e 20 41 6c 6c 20 69 6e | 73 74 61 6e 74 69 61 62 |. All in|stantiab|
|00001be0| 6c 65 20 67 65 6f 6d 65 | 74 72 79 20 63 6c 61 73 |le geome|try clas|
|00001bf0| 73 65 73 20 61 72 65 20 | 64 65 66 69 6e 65 64 20 |ses are |defined |
|00001c00| 73 6f 20 74 68 61 74 0a | 76 61 6c 69 64 20 69 6e |so that.|valid in|
|00001c10| 73 74 61 6e 63 65 73 20 | 6f 66 20 61 20 67 65 6f |stances |of a geo|
|00001c20| 6d 65 74 72 79 20 63 6c | 61 73 73 20 61 72 65 20 |metry cl|ass are |
|00001c30| 74 6f 70 6f 6c 6f 67 69 | 63 61 6c 6c 79 20 63 6c |topologi|cally cl|
|00001c40| 6f 73 65 64 20 28 74 68 | 61 74 20 69 73 2c 0a 61 |osed (th|at is,.a|
|00001c50| 6c 6c 20 64 65 66 69 6e | 65 64 20 67 65 6f 6d 65 |ll defin|ed geome|
|00001c60| 74 72 69 65 73 20 69 6e | 63 6c 75 64 65 20 74 68 |tries in|clude th|
|00001c70| 65 69 72 20 62 6f 75 6e | 64 61 72 79 29 2e 0a 0a |eir boun|dary)...|
|00001c80| 54 68 65 20 62 61 73 65 | 20 47 65 6f 6d 65 74 72 |The base| Geometr|
|00001c90| 79 20 63 6c 61 73 73 20 | 68 61 73 20 73 75 62 63 |y class |has subc|
|00001ca0| 6c 61 73 73 65 73 20 66 | 6f 72 20 50 6f 69 6e 74 |lasses f|or Point|
|00001cb0| 2c 20 43 75 72 76 65 2c | 20 53 75 72 66 61 63 65 |, Curve,| Surface|
|00001cc0| 2c 20 61 6e 64 0a 47 65 | 6f 6d 65 74 72 79 43 6f |, and.Ge|ometryCo|
|00001cd0| 6c 6c 65 63 74 69 6f 6e | 3a 0a 0a 6f 20 50 6f 69 |llection|:..o Poi|
|00001ce0| 6e 74 20 72 65 70 72 65 | 73 65 6e 74 73 20 7a 65 |nt repre|sents ze|
|00001cf0| 72 6f 2d 64 69 6d 65 6e | 73 69 6f 6e 61 6c 20 6f |ro-dimen|sional o|
|00001d00| 62 6a 65 63 74 73 2e 0a | 0a 6f 20 43 75 72 76 65 |bjects..|.o Curve|
|00001d10| 20 72 65 70 72 65 73 65 | 6e 74 73 20 6f 6e 65 2d | represe|nts one-|
|00001d20| 64 69 6d 65 6e 73 69 6f | 6e 61 6c 20 6f 62 6a 65 |dimensio|nal obje|
|00001d30| 63 74 73 2c 20 61 6e 64 | 20 68 61 73 20 73 75 62 |cts, and| has sub|
|00001d40| 63 6c 61 73 73 0a 20 20 | 4c 69 6e 65 53 74 72 69 |class. |LineStri|
|00001d50| 6e 67 2c 20 77 69 74 68 | 20 73 75 62 2d 73 75 62 |ng, with| sub-sub|
|00001d60| 63 6c 61 73 73 65 73 20 | 4c 69 6e 65 20 61 6e 64 |classes |Line and|
|00001d70| 20 4c 69 6e 65 61 72 52 | 69 6e 67 2e 0a 0a 6f 20 | LinearR|ing...o |
|00001d80| 53 75 72 66 61 63 65 20 | 69 73 20 64 65 73 69 67 |Surface |is desig|
|00001d90| 6e 65 64 20 66 6f 72 20 | 74 77 6f 2d 64 69 6d 65 |ned for |two-dime|
|00001da0| 6e 73 69 6f 6e 61 6c 20 | 6f 62 6a 65 63 74 73 20 |nsional |objects |
|00001db0| 61 6e 64 20 68 61 73 20 | 73 75 62 63 6c 61 73 73 |and has |subclass|
|00001dc0| 0a 20 20 50 6f 6c 79 67 | 6f 6e 2e 0a 0a 6f 20 47 |. Polyg|on...o G|
|00001dd0| 65 6f 6d 65 74 72 79 43 | 6f 6c 6c 65 63 74 69 6f |eometryC|ollectio|
|00001de0| 6e 20 68 61 73 20 73 70 | 65 63 69 61 6c 69 7a 65 |n has sp|ecialize|
|00001df0| 64 20 7a 65 72 6f 2d 2c | 20 6f 6e 65 2d 2c 20 61 |d zero-,| one-, a|
|00001e00| 6e 64 20 74 77 6f 2d 64 | 69 6d 65 6e 73 69 6f 6e |nd two-d|imension|
|00001e10| 61 6c 0a 20 20 63 6f 6c | 6c 65 63 74 69 6f 6e 20 |al. col|lection |
|00001e20| 63 6c 61 73 73 65 73 20 | 6e 61 6d 65 64 20 4d 75 |classes |named Mu|
|00001e30| 6c 74 69 50 6f 69 6e 74 | 2c 20 4d 75 6c 74 69 4c |ltiPoint|, MultiL|
|00001e40| 69 6e 65 53 74 72 69 6e | 67 2c 20 61 6e 64 0a 20 |ineStrin|g, and. |
|00001e50| 20 4d 75 6c 74 69 50 6f | 6c 79 67 6f 6e 20 66 6f | MultiPo|lygon fo|
|00001e60| 72 20 6d 6f 64 65 6c 69 | 6e 67 20 67 65 6f 6d 65 |r modeli|ng geome|
|00001e70| 74 72 69 65 73 20 63 6f | 72 72 65 73 70 6f 6e 64 |tries co|rrespond|
|00001e80| 69 6e 67 20 74 6f 20 63 | 6f 6c 6c 65 63 74 69 6f |ing to c|ollectio|
|00001e90| 6e 73 20 6f 66 0a 20 20 | 50 6f 69 6e 74 73 2c 20 |ns of. |Points, |
|00001ea0| 4c 69 6e 65 53 74 72 69 | 6e 67 73 2c 20 61 6e 64 |LineStri|ngs, and|
|00001eb0| 20 50 6f 6c 79 67 6f 6e | 73 2c 20 72 65 73 70 65 | Polygon|s, respe|
|00001ec0| 63 74 69 76 65 6c 79 2e | 20 4d 75 6c 74 69 43 75 |ctively.| MultiCu|
|00001ed0| 72 76 65 20 61 6e 64 0a | 20 20 4d 75 6c 74 69 53 |rve and.| MultiS|
|00001ee0| 75 72 66 61 63 65 20 61 | 72 65 20 69 6e 74 72 6f |urface a|re intro|
|00001ef0| 64 75 63 65 64 20 61 73 | 20 61 62 73 74 72 61 63 |duced as| abstrac|
|00001f00| 74 20 73 75 70 65 72 63 | 6c 61 73 73 65 73 20 74 |t superc|lasses t|
|00001f10| 68 61 74 20 67 65 6e 65 | 72 61 6c 69 7a 65 0a 20 |hat gene|ralize. |
|00001f20| 20 74 68 65 20 63 6f 6c | 6c 65 63 74 69 6f 6e 20 | the col|lection |
|00001f30| 69 6e 74 65 72 66 61 63 | 65 73 20 74 6f 20 68 61 |interfac|es to ha|
|00001f40| 6e 64 6c 65 20 43 75 72 | 76 65 73 20 61 6e 64 20 |ndle Cur|ves and |
|00001f50| 53 75 72 66 61 63 65 73 | 2e 0a 0a 47 65 6f 6d 65 |Surfaces|...Geome|
|00001f60| 74 72 79 2c 20 43 75 72 | 76 65 2c 20 53 75 72 66 |try, Cur|ve, Surf|
|00001f70| 61 63 65 2c 20 4d 75 6c | 74 69 43 75 72 76 65 2c |ace, Mul|tiCurve,|
|00001f80| 20 61 6e 64 20 4d 75 6c | 74 69 53 75 72 66 61 63 | and Mul|tiSurfac|
|00001f90| 65 20 61 72 65 20 64 65 | 66 69 6e 65 64 20 61 73 |e are de|fined as|
|00001fa0| 0a 6e 6f 6e 2d 69 6e 73 | 74 61 6e 74 69 61 62 6c |.non-ins|tantiabl|
|00001fb0| 65 20 63 6c 61 73 73 65 | 73 2e 20 54 68 65 79 20 |e classe|s. They |
|00001fc0| 64 65 66 69 6e 65 20 61 | 20 63 6f 6d 6d 6f 6e 20 |define a| common |
|00001fd0| 73 65 74 20 6f 66 20 6d | 65 74 68 6f 64 73 20 66 |set of m|ethods f|
|00001fe0| 6f 72 20 74 68 65 69 72 | 0a 73 75 62 63 6c 61 73 |or their|.subclas|
|00001ff0| 73 65 73 20 61 6e 64 20 | 61 72 65 20 69 6e 63 6c |ses and |are incl|
|00002000| 75 64 65 64 20 66 6f 72 | 20 65 78 74 65 6e 73 69 |uded for| extensi|
|00002010| 62 69 6c 69 74 79 2e 0a | 0a 50 6f 69 6e 74 2c 20 |bility..|.Point, |
|00002020| 4c 69 6e 65 53 74 72 69 | 6e 67 2c 20 50 6f 6c 79 |LineStri|ng, Poly|
|00002030| 67 6f 6e 2c 20 47 65 6f | 6d 65 74 72 79 43 6f 6c |gon, Geo|metryCol|
|00002040| 6c 65 63 74 69 6f 6e 2c | 20 4d 75 6c 74 69 50 6f |lection,| MultiPo|
|00002050| 69 6e 74 2c 0a 4d 75 6c | 74 69 4c 69 6e 65 53 74 |int,.Mul|tiLineSt|
|00002060| 72 69 6e 67 2c 20 61 6e | 64 20 4d 75 6c 74 69 50 |ring, an|d MultiP|
|00002070| 6f 6c 79 67 6f 6e 20 61 | 72 65 20 69 6e 73 74 61 |olygon a|re insta|
|00002080| 6e 74 69 61 62 6c 65 20 | 63 6c 61 73 73 65 73 2e |ntiable |classes.|
|00002090| 0a 0a 55 52 4c 3a 20 68 | 74 74 70 3a 2f 2f 64 65 |..URL: h|ttp://de|
|000020a0| 76 2e 6d 79 73 71 6c 2e | 63 6f 6d 2f 64 6f 63 2f |v.mysql.|com/doc/|
|000020b0| 72 65 66 6d 61 6e 2f 35 | 2e 30 2f 65 6e 2f 67 69 |refman/5|.0/en/gi|
|000020c0| 73 2d 67 65 6f 6d 65 74 | 72 79 2d 63 6c 61 73 73 |s-geomet|ry-class|
|000020d0| 2d 68 69 65 72 61 72 63 | 68 79 2e 68 74 6d 6c 0a |-hierarc|hy.html.|
|000020e0| 0a 48 68 74 74 70 3a 2f | 2f 64 65 76 2e 6d 79 73 |.Hhttp:/|/dev.mys|
|000020f0| 71 6c 2e 63 6f 6d 2f 64 | 6f 63 2f 72 65 66 6d 61 |ql.com/d|oc/refma|
|00002100| 6e 2f 35 2e 30 2f 65 6e | 2f 67 69 73 2d 67 65 6f |n/5.0/en|/gis-geo|
|00002110| 6d 65 74 72 79 2d 63 6c | 61 73 73 2d 68 69 65 72 |metry-cl|ass-hier|
|00002120| 61 72 63 68 79 2e 68 74 | 6d 6c 00 00 03 07 f8 00 |archy.ht|ml......|
|00002130| 22 0a 00 00 00 0d 43 48 | 41 52 20 46 55 4e 43 54 |".....CH|AR FUNCT|
|00002140| 49 4f 4e 21 00 33 07 53 | 79 6e 74 61 78 3a 0a 43 |ION!.3.S|yntax:.C|
|00002150| 48 41 52 28 4e 2c 2e 2e | 2e 20 5b 55 53 49 4e 47 |HAR(N,..|. [USING|
|00002160| 20 63 68 61 72 73 65 74 | 5f 6e 61 6d 65 5d 29 0a | charset|_name]).|
|00002170| 0a 43 48 41 52 28 29 20 | 69 6e 74 65 72 70 72 65 |.CHAR() |interpre|
|00002180| 74 73 20 65 61 63 68 20 | 61 72 67 75 6d 65 6e 74 |ts each |argument|
|00002190| 20 4e 20 61 73 20 61 6e | 20 69 6e 74 65 67 65 72 | N as an| integer|
|000021a0| 20 61 6e 64 20 72 65 74 | 75 72 6e 73 20 61 20 73 | and ret|urns a s|
|000021b0| 74 72 69 6e 67 0a 63 6f | 6e 73 69 73 74 69 6e 67 |tring.co|nsisting|
|000021c0| 20 6f 66 20 74 68 65 20 | 63 68 61 72 61 63 74 65 | of the |characte|
|000021d0| 72 73 20 67 69 76 65 6e | 20 62 79 20 74 68 65 20 |rs given| by the |
|000021e0| 63 6f 64 65 20 76 61 6c | 75 65 73 20 6f 66 20 74 |code val|ues of t|
|000021f0| 68 6f 73 65 0a 69 6e 74 | 65 67 65 72 73 2e 20 4e |hose.int|egers. N|
|00002200| 55 4c 4c 20 76 61 6c 75 | 65 73 20 61 72 65 20 73 |ULL valu|es are s|
|00002210| 6b 69 70 70 65 64 2e 0a | 41 73 20 6f 66 20 4d 79 |kipped..|As of My|
|00002220| 53 51 4c 20 35 2e 30 2e | 31 35 2c 20 43 48 41 52 |SQL 5.0.|15, CHAR|
|00002230| 28 29 20 61 72 67 75 6d | 65 6e 74 73 20 6c 61 72 |() argum|ents lar|
|00002240| 67 65 72 20 74 68 61 6e | 20 32 35 35 20 61 72 65 |ger than| 255 are|
|00002250| 20 63 6f 6e 76 65 72 74 | 65 64 20 69 6e 74 6f 0a | convert|ed into.|
|00002260| 6d 75 6c 74 69 70 6c 65 | 20 72 65 73 75 6c 74 20 |multiple| result |
|00002270| 62 79 74 65 73 2e 20 46 | 6f 72 20 65 78 61 6d 70 |bytes. F|or examp|
|00002280| 6c 65 2c 20 43 48 41 52 | 28 32 35 36 29 20 69 73 |le, CHAR|(256) is|
|00002290| 20 65 71 75 69 76 61 6c | 65 6e 74 20 74 6f 0a 43 | equival|ent to.C|
|000022a0| 48 41 52 28 31 2c 30 29 | 2c 20 61 6e 64 20 43 48 |HAR(1,0)|, and CH|
|000022b0| 41 52 28 32 35 36 2a 32 | 35 36 29 20 69 73 20 65 |AR(256*2|56) is e|
|000022c0| 71 75 69 76 61 6c 65 6e | 74 20 74 6f 20 43 48 41 |quivalen|t to CHA|
|000022d0| 52 28 31 2c 30 2c 30 29 | 3a 0a 0a 6d 79 73 71 6c |R(1,0,0)|:..mysql|
|000022e0| 3e 20 53 45 4c 45 43 54 | 20 48 45 58 28 43 48 41 |> SELECT| HEX(CHA|
|000022f0| 52 28 31 2c 30 29 29 2c | 20 48 45 58 28 43 48 41 |R(1,0)),| HEX(CHA|
|00002300| 52 28 32 35 36 29 29 3b | 0a 2b 2d 2d 2d 2d 2d 2d |R(256));|.+------|
|00002310| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2b 2d 2d 2d 2d 2d |--------|--+-----|
|00002320| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2b 0a 7c 20 48 |--------|---+.| H|
|00002330| 45 58 28 43 48 41 52 28 | 31 2c 30 29 29 20 7c 20 |EX(CHAR(|1,0)) | |
|00002340| 48 45 58 28 43 48 41 52 | 28 32 35 36 29 29 20 7c |HEX(CHAR|(256)) ||
|00002350| 0a 2b 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.+------|--------|
|00002360| 2d 2d 2b 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--+-----|--------|
|00002370| 2d 2d 2d 2b 0a 7c 20 30 | 31 30 30 20 20 20 20 20 |---+.| 0|100 |
|00002380| 20 20 20 20 20 20 7c 20 | 30 31 30 30 20 20 20 20 | | |0100 |
|00002390| 20 20 20 20 20 20 20 7c | 0a 2b 2d 2d 2d 2d 2d 2d | ||.+------|
|000023a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2b 2d 2d 2d 2d 2d |--------|--+-----|
|000023b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2b 0a 6d 79 73 |--------|---+.mys|
|000023c0| 71 6c 3e 20 53 45 4c 45 | 43 54 20 48 45 58 28 43 |ql> SELE|CT HEX(C|
|000023d0| 48 41 52 28 31 2c 30 2c | 30 29 29 2c 20 48 45 58 |HAR(1,0,|0)), HEX|
|000023e0| 28 43 48 41 52 28 32 35 | 36 2a 32 35 36 29 29 3b |(CHAR(25|6*256));|
|000023f0| 0a 2b 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.+------|--------|
|00002400| 2d 2d 2d 2d 2b 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |----+---|--------|
|00002410| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2b 0a 7c 20 48 45 58 |--------|-+.| HEX|
|00002420| 28 43 48 41 52 28 31 2c | 30 2c 30 29 29 20 7c 20 |(CHAR(1,|0,0)) | |
|00002430| 48 45 58 28 43 48 41 52 | 28 32 35 36 2a 32 35 36 |HEX(CHAR|(256*256|
|00002440| 29 29 20 7c 0a 2b 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |)) |.+--|--------|
|00002450| 2d 2d 2d 2d 2d 2d 2d 2d | 2b 2d 2d 2d 2d 2d 2d 2d |--------|+-------|
|00002460| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2b 0a 7c |--------|-----+.||
|00002470| 20 30 31 30 30 30 30 20 | 20 20 20 20 20 20 20 20 | 010000 | |
|00002480| 20 20 7c 20 30 31 30 30 | 30 30 20 20 20 20 20 20 | | 0100|00 |
|00002490| 20 20 20 20 20 20 20 7c | 0a 2b 2d 2d 2d 2d 2d 2d | ||.+------|
|000024a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2b 2d 2d 2d |--------|----+---|
|000024b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000024c0| 2d 2b 0a 0a 42 79 20 64 | 65 66 61 75 6c 74 2c 20 |-+..By d|efault, |
|000024d0| 43 48 41 52 28 29 20 72 | 65 74 75 72 6e 73 20 61 |CHAR() r|eturns a|
|000024e0| 20 62 69 6e 61 72 79 20 | 73 74 72 69 6e 67 2e 20 | binary |string. |
|000024f0| 54 6f 20 70 72 6f 64 75 | 63 65 20 61 20 73 74 72 |To produ|ce a str|
|00002500| 69 6e 67 20 69 6e 20 61 | 0a 67 69 76 65 6e 20 63 |ing in a|.given c|
|00002510| 68 61 72 61 63 74 65 72 | 20 73 65 74 2c 20 75 73 |haracter| set, us|
|00002520| 65 20 74 68 65 20 6f 70 | 74 69 6f 6e 61 6c 20 55 |e the op|tional U|
|00002530| 53 49 4e 47 20 63 6c 61 | 75 73 65 3a 0a 0a 6d 79 |SING cla|use:..my|
|00002540| 73 71 6c 3e 20 53 45 4c | 45 43 54 20 43 48 41 52 |sql> SEL|ECT CHAR|
|00002550| 53 45 54 28 43 48 41 52 | 28 30 78 36 35 29 29 2c |SET(CHAR|(0x65)),|
|00002560| 20 43 48 41 52 53 45 54 | 28 43 48 41 52 28 30 78 | CHARSET|(CHAR(0x|
|00002570| 36 35 20 55 53 49 4e 47 | 20 75 74 66 38 29 29 3b |65 USING| utf8));|
|00002580| 0a 2b 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.+------|--------|
|00002590| 2d 2d 2d 2d 2d 2d 2d 2b | 2d 2d 2d 2d 2d 2d 2d 2d |-------+|--------|
|000025a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000025b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2b 0a 7c 20 43 48 41 52 |--------|+.| CHAR|
|000025c0| 53 45 54 28 43 48 41 52 | 28 30 78 36 35 29 29 20 |SET(CHAR|(0x65)) |
|000025d0| 7c 20 43 48 41 52 53 45 | 54 28 43 48 41 52 28 30 || CHARSE|T(CHAR(0|
|000025e0| 78 36 35 20 55 53 49 4e | 47 20 75 74 66 38 29 29 |x65 USIN|G utf8))|
|000025f0| 20 7c 0a 2b 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | |.+----|--------|
|00002600| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2b 2d 2d 2d 2d 2d 2d |--------|-+------|
|00002610| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002620| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2b 0a 7c 20 62 69 |--------|--+.| bi|
|00002630| 6e 61 72 79 20 20 20 20 | 20 20 20 20 20 20 20 20 |nary | |
|00002640| 20 20 7c 20 75 74 66 38 | 20 20 20 20 20 20 20 20 | | utf8| |
|00002650| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002660| 20 20 20 7c 0a 2b 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | |.+--|--------|
|00002670| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2b 2d 2d 2d 2d |--------|---+----|
|00002680| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002690| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2b 0a 0a 49 |--------|----+..I|
|000026a0| 66 20 55 53 49 4e 47 20 | 69 73 20 67 69 76 65 6e |f USING |is given|
|000026b0| 20 61 6e 64 20 74 68 65 | 20 72 65 73 75 6c 74 20 | and the| result |
|000026c0| 73 74 72 69 6e 67 20 69 | 73 20 69 6c 6c 65 67 61 |string i|s illega|
|000026d0| 6c 20 66 6f 72 20 74 68 | 65 20 67 69 76 65 6e 0a |l for th|e given.|
|000026e0| 63 68 61 72 61 63 74 65 | 72 20 73 65 74 2c 20 61 |characte|r set, a|
|000026f0| 20 77 61 72 6e 69 6e 67 | 20 69 73 20 69 73 73 75 | warning| is issu|
|00002700| 65 64 2e 20 41 6c 73 6f | 2c 20 69 66 20 73 74 72 |ed. Also|, if str|
|00002710| 69 63 74 20 53 51 4c 20 | 6d 6f 64 65 20 69 73 0a |ict SQL |mode is.|
|00002720| 65 6e 61 62 6c 65 64 2c | 20 74 68 65 20 72 65 73 |enabled,| the res|
|00002730| 75 6c 74 20 66 72 6f 6d | 20 43 48 41 52 28 29 20 |ult from| CHAR() |
|00002740| 62 65 63 6f 6d 65 73 20 | 4e 55 4c 4c 2e 0a 0a 42 |becomes |NULL...B|
|00002750| 65 66 6f 72 65 20 4d 79 | 53 51 4c 20 35 2e 30 2e |efore My|SQL 5.0.|
|00002760| 31 35 2c 20 43 48 41 52 | 28 29 20 72 65 74 75 72 |15, CHAR|() retur|
|00002770| 6e 73 20 61 20 73 74 72 | 69 6e 67 20 69 6e 20 74 |ns a str|ing in t|
|00002780| 68 65 20 63 6f 6e 6e 65 | 63 74 69 6f 6e 0a 63 68 |he conne|ction.ch|
|00002790| 61 72 61 63 74 65 72 20 | 73 65 74 20 61 6e 64 20 |aracter |set and |
|000027a0| 74 68 65 20 55 53 49 4e | 47 20 63 6c 61 75 73 65 |the USIN|G clause|
|000027b0| 20 69 73 20 75 6e 61 76 | 61 69 6c 61 62 6c 65 2e | is unav|ailable.|
|000027c0| 20 49 6e 20 61 64 64 69 | 74 69 6f 6e 2c 20 65 61 | In addi|tion, ea|
|000027d0| 63 68 0a 61 72 67 75 6d | 65 6e 74 20 69 73 20 69 |ch.argum|ent is i|
|000027e0| 6e 74 65 72 70 72 65 74 | 65 64 20 6d 6f 64 75 6c |nterpret|ed modul|
|000027f0| 6f 20 32 35 36 2c 20 73 | 6f 20 43 48 41 52 28 32 |o 256, s|o CHAR(2|
|00002800| 35 36 29 20 61 6e 64 20 | 43 48 41 52 28 32 35 36 |56) and |CHAR(256|
|00002810| 2a 32 35 36 29 20 62 6f | 74 68 0a 61 72 65 20 65 |*256) bo|th.are e|
|00002820| 71 75 69 76 61 6c 65 6e | 74 20 74 6f 20 43 48 41 |quivalen|t to CHA|
|00002830| 52 28 30 29 2e 0a 0a 55 | 52 4c 3a 20 68 74 74 70 |R(0)...U|RL: http|
|00002840| 3a 2f 2f 64 65 76 2e 6d | 79 73 71 6c 2e 63 6f 6d |://dev.m|ysql.com|
|00002850| 2f 64 6f 63 2f 72 65 66 | 6d 61 6e 2f 35 2e 30 2f |/doc/ref|man/5.0/|
|00002860| 65 6e 2f 73 74 72 69 6e | 67 2d 66 75 6e 63 74 69 |en/strin|g-functi|
|00002870| 6f 6e 73 2e 68 74 6d 6c | 0a 0a 6f 00 6d 79 73 71 |ons.html|..o.mysq|
|00002880| 6c 3e 20 53 45 4c 45 43 | 54 20 43 48 41 52 28 37 |l> SELEC|T CHAR(7|
|00002890| 37 2c 31 32 31 2c 38 33 | 2c 38 31 2c 27 37 36 27 |7,121,83|,81,'76'|
|000028a0| 29 3b 0a 20 20 20 20 20 | 20 20 20 2d 3e 20 27 4d |);. | -> 'M|
|000028b0| 79 53 51 4c 27 0a 6d 79 | 73 71 6c 3e 20 53 45 4c |ySQL'.my|sql> SEL|
|000028c0| 45 43 54 20 43 48 41 52 | 28 37 37 2c 37 37 2e 33 |ECT CHAR|(77,77.3|
|000028d0| 2c 27 37 37 2e 33 27 29 | 3b 0a 20 20 20 20 20 20 |,'77.3')|;. |
|000028e0| 20 20 2d 3e 20 27 4d 4d | 4d 27 0a 3c 68 74 74 70 | -> 'MM|M'.<http|
|000028f0| 3a 2f 2f 64 65 76 2e 6d | 79 73 71 6c 2e 63 6f 6d |://dev.m|ysql.com|
|00002900| 2f 64 6f 63 2f 72 65 66 | 6d 61 6e 2f 35 2e 30 2f |/doc/ref|man/5.0/|
|00002910| 65 6e 2f 73 74 72 69 6e | 67 2d 66 75 6e 63 74 69 |en/strin|g-functi|
|00002920| 6f 6e 73 2e 68 74 6d 6c | 03 01 ac 00 32 0b 00 00 |ons.html|....2...|
|00002930| 00 08 44 41 54 45 54 49 | 4d 45 14 00 52 01 44 41 |..DATETI|ME..R.DA|
|00002940| 54 45 54 49 4d 45 0a 0a | 41 20 64 61 74 65 20 61 |TETIME..|A date a|
|00002950| 6e 64 20 74 69 6d 65 20 | 63 6f 6d 62 69 6e 61 74 |nd time |combinat|
|00002960| 69 6f 6e 2e 20 54 68 65 | 20 73 75 70 70 6f 72 74 |ion. The| support|
|00002970| 65 64 20 72 61 6e 67 65 | 20 69 73 20 27 31 30 30 |ed range| is '100|
|00002980| 30 2d 30 31 2d 30 31 0a | 30 30 3a 30 30 3a 30 30 |0-01-01.|00:00:00|
|00002990| 27 20 74 6f 20 27 39 39 | 39 39 2d 31 32 2d 33 31 |' to '99|99-12-31|
|000029a0| 20 32 33 3a 35 39 3a 35 | 39 27 2e 20 4d 79 53 51 | 23:59:5|9'. MySQ|
|000029b0| 4c 20 64 69 73 70 6c 61 | 79 73 20 44 41 54 45 54 |L displa|ys DATET|
|000029c0| 49 4d 45 20 76 61 6c 75 | 65 73 20 69 6e 0a 27 59 |IME valu|es in.'Y|
|000029d0| 59 59 59 2d 4d 4d 2d 44 | 44 20 48 48 3a 4d 4d 3a |YYY-MM-D|D HH:MM:|
|000029e0| 53 53 27 20 66 6f 72 6d | 61 74 2c 20 62 75 74 20 |SS' form|at, but |
|000029f0| 61 6c 6c 6f 77 73 20 61 | 73 73 69 67 6e 6d 65 6e |allows a|ssignmen|
|00002a00| 74 20 6f 66 20 76 61 6c | 75 65 73 20 74 6f 0a 44 |t of val|ues to.D|
|00002a10| 41 54 45 54 49 4d 45 20 | 63 6f 6c 75 6d 6e 73 20 |ATETIME |columns |
|00002a20| 75 73 69 6e 67 20 65 69 | 74 68 65 72 20 73 74 72 |using ei|ther str|
|00002a30| 69 6e 67 73 20 6f 72 20 | 6e 75 6d 62 65 72 73 2e |ings or |numbers.|
|00002a40| 0a 0a 55 52 4c 3a 20 68 | 74 74 70 3a 2f 2f 64 65 |..URL: h|ttp://de|
|00002a50| 76 2e 6d 79 73 71 6c 2e | 63 6f 6d 2f 64 6f 63 2f |v.mysql.|com/doc/|
|00002a60| 72 65 66 6d 61 6e 2f 35 | 2e 30 2f 65 6e 2f 64 61 |refman/5|.0/en/da|
|00002a70| 74 65 2d 61 6e 64 2d 74 | 69 6d 65 2d 74 79 70 65 |te-and-t|ime-type|
|00002a80| 2d 6f 76 65 72 76 69 65 | 77 2e 68 74 6d 6c 0a 0a |-overvie|w.html..|
|00002a90| 47 68 74 74 70 3a 2f 2f | 64 65 76 2e 6d 79 73 71 |Ghttp://|dev.mysq|
|00002aa0| 6c 2e 63 6f 6d 2f 64 6f | 63 2f 72 65 66 6d 61 6e |l.com/do|c/refman|
|00002ab0| 2f 35 2e 30 2f 65 6e 2f | 64 61 74 65 2d 61 6e 64 |/5.0/en/|date-and|
|00002ac0| 2d 74 69 6d 65 2d 74 79 | 70 65 2d 6f 76 65 72 76 |-time-ty|pe-overv|
|00002ad0| 69 65 77 2e 68 74 6d 6c | 03 00 c4 00 32 0c 00 00 |iew.html|....2...|
|00002ae0| 00 04 4f 50 45 4e 23 00 | 85 00 53 79 6e 74 61 78 |..OPEN#.|..Syntax|
|00002af0| 3a 0a 4f 50 45 4e 20 63 | 75 72 73 6f 72 5f 6e 61 |:.OPEN c|ursor_na|
|00002b00| 6d 65 0a 0a 54 68 69 73 | 20 73 74 61 74 65 6d 65 |me..This| stateme|
|00002b10| 6e 74 20 6f 70 65 6e 73 | 20 61 20 70 72 65 76 69 |nt opens| a previ|
|00002b20| 6f 75 73 6c 79 20 64 65 | 63 6c 61 72 65 64 20 63 |ously de|clared c|
|00002b30| 75 72 73 6f 72 2e 0a 0a | 55 52 4c 3a 20 68 74 74 |ursor...|URL: htt|
|00002b40| 70 3a 2f 2f 64 65 76 2e | 6d 79 73 71 6c 2e 63 6f |p://dev.|mysql.co|
|00002b50| 6d 2f 64 6f 63 2f 72 65 | 66 6d 61 6e 2f 35 2e 30 |m/doc/re|fman/5.0|
|00002b60| 2f 65 6e 2f 6f 70 65 6e | 2e 68 74 6d 6c 0a 0a 30 |/en/open|.html..0|
|00002b70| 68 74 74 70 3a 2f 2f 64 | 65 76 2e 6d 79 73 71 6c |http://d|ev.mysql|
|00002b80| 2e 63 6f 6d 2f 64 6f 63 | 2f 72 65 66 6d 61 6e 2f |.com/doc|/refman/|
|00002b90| 35 2e 30 2f 65 6e 2f 6f | 70 65 6e 2e 68 74 6d 6c |5.0/en/o|pen.html|
|00002ba0| 03 02 eb 01 22 0d 00 00 | 00 15 53 48 4f 57 20 43 |...."...|..SHOW C|
|00002bb0| 52 45 41 54 45 20 50 52 | 4f 43 45 44 55 52 45 18 |REATE PR|OCEDURE.|
|00002bc0| 00 7b 01 53 79 6e 74 61 | 78 3a 0a 53 48 4f 57 20 |.{.Synta|x:.SHOW |
|00002bd0| 43 52 45 41 54 45 20 7b | 50 52 4f 43 45 44 55 52 |CREATE {|PROCEDUR|
|00002be0| 45 20 7c 20 46 55 4e 43 | 54 49 4f 4e 7d 20 73 70 |E | FUNC|TION} sp|
|00002bf0| 5f 6e 61 6d 65 0a 0a 54 | 68 65 73 65 20 73 74 61 |_name..T|hese sta|
|00002c00| 74 65 6d 65 6e 74 73 20 | 61 72 65 20 4d 79 53 51 |tements |are MySQ|
|00002c10| 4c 20 65 78 74 65 6e 73 | 69 6f 6e 73 2e 20 53 69 |L extens|ions. Si|
|00002c20| 6d 69 6c 61 72 20 74 6f | 20 53 48 4f 57 20 43 52 |milar to| SHOW CR|
|00002c30| 45 41 54 45 20 54 41 42 | 4c 45 2c 0a 74 68 65 79 |EATE TAB|LE,.they|
|00002c40| 20 72 65 74 75 72 6e 20 | 74 68 65 20 65 78 61 63 | return |the exac|
|00002c50| 74 20 73 74 72 69 6e 67 | 20 74 68 61 74 20 63 61 |t string| that ca|
|00002c60| 6e 20 62 65 20 75 73 65 | 64 20 74 6f 20 72 65 2d |n be use|d to re-|
|00002c70| 63 72 65 61 74 65 20 74 | 68 65 20 6e 61 6d 65 64 |create t|he named|
|00002c80| 0a 72 6f 75 74 69 6e 65 | 2e 20 54 68 65 20 73 74 |.routine|. The st|
|00002c90| 61 74 65 6d 65 6e 74 73 | 20 72 65 71 75 69 72 65 |atements| require|
|00002ca0| 20 74 68 61 74 20 79 6f | 75 20 62 65 20 74 68 65 | that yo|u be the|
|00002cb0| 20 6f 77 6e 65 72 20 6f | 66 20 74 68 65 20 72 6f | owner o|f the ro|
|00002cc0| 75 74 69 6e 65 20 6f 72 | 0a 68 61 76 65 20 53 45 |utine or|.have SE|
|00002cd0| 4c 45 43 54 20 61 63 63 | 65 73 73 20 74 6f 20 74 |LECT acc|ess to t|
|00002ce0| 68 65 20 6d 79 73 71 6c | 2e 70 72 6f 63 20 74 61 |he mysql|.proc ta|
|00002cf0| 62 6c 65 2e 0a 0a 55 52 | 4c 3a 20 68 74 74 70 3a |ble...UR|L: http:|
|00002d00| 2f 2f 64 65 76 2e 6d 79 | 73 71 6c 2e 63 6f 6d 2f |//dev.my|sql.com/|
|00002d10| 64 6f 63 2f 72 65 66 6d | 61 6e 2f 35 2e 30 2f 65 |doc/refm|an/5.0/e|
|00002d20| 6e 2f 73 68 6f 77 2d 63 | 72 65 61 74 65 2d 70 72 |n/show-c|reate-pr|
|00002d30| 6f 63 65 64 75 72 65 2e | 68 74 6d 6c 0a 0a 0d 01 |ocedure.|html....|
|00002d40| 6d 79 73 71 6c 3e 20 53 | 48 4f 57 20 43 52 45 41 |mysql> S|HOW CREA|
|00002d50| 54 45 20 46 55 4e 43 54 | 49 4f 4e 20 74 65 73 74 |TE FUNCT|ION test|
|00002d60| 2e 68 65 6c 6c 6f 5c 47 | 0a 2a 2a 2a 2a 2a 2a 2a |.hello\G|.*******|
|00002d70| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002d80| 2a 2a 2a 2a 20 31 2e 20 | 72 6f 77 20 2a 2a 2a 2a |**** 1. |row ****|
|00002d90| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002da0| 2a 2a 2a 2a 2a 2a 2a 0a | 20 20 20 20 20 20 20 46 |*******.| F|
|00002db0| 75 6e 63 74 69 6f 6e 3a | 20 68 65 6c 6c 6f 0a 20 |unction:| hello. |
|00002dc0| 20 20 20 20 20 20 73 71 | 6c 5f 6d 6f 64 65 3a 0a | sq|l_mode:.|
|00002dd0| 43 72 65 61 74 65 20 46 | 75 6e 63 74 69 6f 6e 3a |Create F|unction:|
|00002de0| 20 43 52 45 41 54 45 20 | 46 55 4e 43 54 49 4f 4e | CREATE |FUNCTION|
|00002df0| 20 60 74 65 73 74 60 2e | 60 68 65 6c 6c 6f 60 28 | `test`.|`hello`(|
|00002e00| 73 20 43 48 41 52 28 32 | 30 29 29 20 52 45 54 55 |s CHAR(2|0)) RETU|
|00002e10| 52 4e 53 20 43 48 41 52 | 28 35 30 29 0a 20 20 20 |RNS CHAR|(50). |
|00002e20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 52 45 | | RE|
|00002e30| 54 55 52 4e 20 43 4f 4e | 43 41 54 28 27 48 65 6c |TURN CON|CAT('Hel|
|00002e40| 6c 6f 2c 20 27 2c 73 2c | 27 21 27 29 0a 41 68 74 |lo, ',s,|'!').Aht|
|00002e50| 74 70 3a 2f 2f 64 65 76 | 2e 6d 79 73 71 6c 2e 63 |tp://dev|.mysql.c|
|00002e60| 6f 6d 2f 64 6f 63 2f 72 | 65 66 6d 61 6e 2f 35 2e |om/doc/r|efman/5.|
|00002e70| 30 2f 65 6e 2f 73 68 6f | 77 2d 63 72 65 61 74 65 |0/en/sho|w-create|
|00002e80| 2d 70 72 6f 63 65 64 75 | 72 65 2e 68 74 6d 6c 00 |-procedu|re.html.|
|00002e90| 03 00 e0 00 32 0e 00 00 | 00 07 49 4e 54 45 47 45 |....2...|..INTEGE|
|00002ea0| 52 14 00 8d 00 49 4e 54 | 45 47 45 52 5b 28 4d 29 |R....INT|EGER[(M)|
|00002eb0| 5d 20 5b 55 4e 53 49 47 | 4e 45 44 5d 20 5b 5a 45 |] [UNSIG|NED] [ZE|
|00002ec0| 52 4f 46 49 4c 4c 5d 0a | 0a 54 68 69 73 20 74 79 |ROFILL].|.This ty|
|00002ed0| 70 65 20 69 73 20 61 20 | 73 79 6e 6f 6e 79 6d 20 |pe is a |synonym |
|00002ee0| 66 6f 72 20 49 4e 54 2e | 0a 0a 55 52 4c 3a 20 68 |for INT.|..URL: h|
|00002ef0| 74 74 70 3a 2f 2f 64 65 | 76 2e 6d 79 73 71 6c 2e |ttp://de|v.mysql.|
|00002f00| 63 6f 6d 2f 64 6f 63 2f | 72 65 66 6d 61 6e 2f 35 |com/doc/|refman/5|
|00002f10| 2e 30 2f 65 6e 2f 6e 75 | 6d 65 72 69 63 2d 74 79 |.0/en/nu|meric-ty|
|00002f20| 70 65 2d 6f 76 65 72 76 | 69 65 77 2e 68 74 6d 6c |pe-overv|iew.html|
|00002f30| 0a 0a 41 68 74 74 70 3a | 2f 2f 64 65 76 2e 6d 79 |..Ahttp:|//dev.my|
|00002f40| 73 71 6c 2e 63 6f 6d 2f | 64 6f 63 2f 72 65 66 6d |sql.com/|doc/refm|
|00002f50| 61 6e 2f 35 2e 30 2f 65 | 6e 2f 6e 75 6d 65 72 69 |an/5.0/e|n/numeri|
|00002f60| 63 2d 74 79 70 65 2d 6f | 76 65 72 76 69 65 77 2e |c-type-o|verview.|
|00002f70| 68 74 6d 6c 01 01 85 22 | 0f 00 00 00 05 4c 4f 57 |html..."|.....LOW|
|00002f80| 45 52 21 00 f6 00 53 79 | 6e 74 61 78 3a 0a 4c 4f |ER!...Sy|ntax:.LO|
|00002f90| 57 45 52 28 73 74 72 29 | 0a 0a 52 65 74 75 72 6e |WER(str)|..Return|
|00002fa0| 73 20 74 68 65 20 73 74 | 72 69 6e 67 20 73 74 72 |s the st|ring str|
|00002fb0| 20 77 69 74 68 20 61 6c | 6c 20 63 68 61 72 61 63 | with al|l charac|
|00002fc0| 74 65 72 73 20 63 68 61 | 6e 67 65 64 20 74 6f 20 |ters cha|nged to |
|00002fd0| 6c 6f 77 65 72 63 61 73 | 65 0a 61 63 63 6f 72 64 |lowercas|e.accord|
|00002fe0| 69 6e 67 20 74 6f 20 74 | 68 65 20 63 75 72 72 65 |ing to t|he curre|
|00002ff0| 6e 74 20 63 68 61 72 61 | 63 74 65 72 20 73 65 74 |nt chara|cter set|
|00003000| 20 6d 61 70 70 69 6e 67 | 2e 20 54 68 65 20 64 65 | mapping|. The de|
|00003010| 66 61 75 6c 74 20 69 73 | 20 6c 61 74 69 6e 31 0a |fault is| latin1.|
|00003020| 28 63 70 31 32 35 32 20 | 57 65 73 74 20 45 75 72 |(cp1252 |West Eur|
|00003030| 6f 70 65 61 6e 29 2e 0a | 0a 55 52 4c 3a 20 68 74 |opean)..|.URL: ht|
|00003040| 74 70 3a 2f 2f 64 65 76 | 2e 6d 79 73 71 6c 2e 63 |tp://dev|.mysql.c|
|00003050| 6f 6d 2f 64 6f 63 2f 72 | 65 66 6d 61 6e 2f 35 2e |om/doc/r|efman/5.|
|00003060| 30 2f 65 6e 2f 73 74 72 | 69 6e 67 2d 66 75 6e 63 |0/en/str|ing-func|
|00003070| 74 69 6f 6e 73 2e 68 74 | 6d 6c 0a 0a 41 00 6d 79 |tions.ht|ml..A.my|
|00003080| 73 71 6c 3e 20 53 45 4c | 45 43 54 20 4c 4f 57 45 |sql> SEL|ECT LOWE|
|00003090| 52 28 27 51 55 41 44 52 | 41 54 49 43 41 4c 4c 59 |R('QUADR|ATICALLY|
|000030a0| 27 29 3b 0a 20 20 20 20 | 20 20 20 20 2d 3e 20 27 |');. | -> '|
|000030b0| 71 75 61 64 72 61 74 69 | 63 61 6c 6c 79 27 0a 3c |quadrati|cally'.<|
|000030c0| 68 74 74 70 3a 2f 2f 64 | 65 76 2e 6d 79 73 71 6c |http://d|ev.mysql|
|000030d0| 2e 63 6f 6d 2f 64 6f 63 | 2f 72 65 66 6d 61 6e 2f |.com/doc|/refman/|
|000030e0| 35 2e 30 2f 65 6e 2f 73 | 74 72 69 6e 67 2d 66 75 |5.0/en/s|tring-fu|
|000030f0| 6e 63 74 69 6f 6e 73 2e | 68 74 6d 6c 03 06 87 01 |nctions.|html....|
|00003100| 32 10 00 00 00 0e 43 52 | 45 41 54 45 20 54 52 49 |2.....CR|EATE TRI|
|00003110| 47 47 45 52 15 00 34 06 | 53 79 6e 74 61 78 3a 0a |GGER..4.|Syntax:.|
|00003120| 43 52 45 41 54 45 0a 20 | 20 20 20 5b 44 45 46 49 |CREATE. | [DEFI|
|00003130| 4e 45 52 20 3d 20 7b 20 | 75 73 65 72 20 7c 20 43 |NER = { |user | C|
|00003140| 55 52 52 45 4e 54 5f 55 | 53 45 52 20 7d 5d 0a 20 |URRENT_U|SER }]. |
|00003150| 20 20 20 54 52 49 47 47 | 45 52 20 74 72 69 67 67 | TRIGG|ER trigg|
|00003160| 65 72 5f 6e 61 6d 65 20 | 74 72 69 67 67 65 72 5f |er_name |trigger_|
|00003170| 74 69 6d 65 20 74 72 69 | 67 67 65 72 5f 65 76 65 |time tri|gger_eve|
|00003180| 6e 74 0a 20 20 20 20 4f | 4e 20 74 62 6c 5f 6e 61 |nt. O|N tbl_na|
|00003190| 6d 65 20 46 4f 52 20 45 | 41 43 48 20 52 4f 57 20 |me FOR E|ACH ROW |
|000031a0| 74 72 69 67 67 65 72 5f | 73 74 6d 74 0a 0a 54 68 |trigger_|stmt..Th|
|000031b0| 69 73 20 73 74 61 74 65 | 6d 65 6e 74 20 63 72 65 |is state|ment cre|
|000031c0| 61 74 65 73 20 61 20 6e | 65 77 20 74 72 69 67 67 |ates a n|ew trigg|
|000031d0| 65 72 2e 20 41 20 74 72 | 69 67 67 65 72 20 69 73 |er. A tr|igger is|
|000031e0| 20 61 20 6e 61 6d 65 64 | 20 64 61 74 61 62 61 73 | a named| databas|
|000031f0| 65 0a 6f 62 6a 65 63 74 | 20 74 68 61 74 20 69 73 |e.object| that is|
|00003200| 20 61 73 73 6f 63 69 61 | 74 65 64 20 77 69 74 68 | associa|ted with|
|00003210| 20 61 20 74 61 62 6c 65 | 2c 20 61 6e 64 20 74 68 | a table|, and th|
|00003220| 61 74 20 61 63 74 69 76 | 61 74 65 73 20 77 68 65 |at activ|ates whe|
|00003230| 6e 20 61 0a 70 61 72 74 | 69 63 75 6c 61 72 20 65 |n a.part|icular e|
|00003240| 76 65 6e 74 20 6f 63 63 | 75 72 73 20 66 6f 72 20 |vent occ|urs for |
|00003250| 74 68 65 20 74 61 62 6c | 65 2e 20 43 52 45 41 54 |the tabl|e. CREAT|
|00003260| 45 20 54 52 49 47 47 45 | 52 20 77 61 73 20 61 64 |E TRIGGE|R was ad|
|00003270| 64 65 64 20 69 6e 0a 4d | 79 53 51 4c 20 35 2e 30 |ded in.M|ySQL 5.0|
|00003280| 2e 32 2e 20 43 75 72 72 | 65 6e 74 6c 79 2c 20 69 |.2. Curr|ently, i|
|00003290| 74 73 20 75 73 65 20 72 | 65 71 75 69 72 65 73 20 |ts use r|equires |
|000032a0| 74 68 65 20 53 55 50 45 | 52 20 70 72 69 76 69 6c |the SUPE|R privil|
|000032b0| 65 67 65 2e 0a 0a 54 68 | 65 20 74 72 69 67 67 65 |ege...Th|e trigge|
|000032c0| 72 20 62 65 63 6f 6d 65 | 73 20 61 73 73 6f 63 69 |r become|s associ|
|000032d0| 61 74 65 64 20 77 69 74 | 68 20 74 68 65 20 74 61 |ated wit|h the ta|
|000032e0| 62 6c 65 20 6e 61 6d 65 | 64 20 74 62 6c 5f 6e 61 |ble name|d tbl_na|
|000032f0| 6d 65 2c 20 77 68 69 63 | 68 0a 6d 75 73 74 20 72 |me, whic|h.must r|
|00003300| 65 66 65 72 20 74 6f 20 | 61 20 70 65 72 6d 61 6e |efer to |a perman|
|00003310| 65 6e 74 20 74 61 62 6c | 65 2e 20 59 6f 75 20 63 |ent tabl|e. You c|
|00003320| 61 6e 6e 6f 74 20 61 73 | 73 6f 63 69 61 74 65 20 |annot as|sociate |
|00003330| 61 20 74 72 69 67 67 65 | 72 20 77 69 74 68 20 61 |a trigge|r with a|
|00003340| 0a 54 45 4d 50 4f 52 41 | 52 59 20 74 61 62 6c 65 |.TEMPORA|RY table|
|00003350| 20 6f 72 20 61 20 76 69 | 65 77 2e 0a 0a 57 68 65 | or a vi|ew...Whe|
|00003360| 6e 20 74 68 65 20 74 72 | 69 67 67 65 72 20 69 73 |n the tr|igger is|
|00003370| 20 61 63 74 69 76 61 74 | 65 64 2c 20 74 68 65 20 | activat|ed, the |
|00003380| 44 45 46 49 4e 45 52 20 | 63 6c 61 75 73 65 20 64 |DEFINER |clause d|
|00003390| 65 74 65 72 6d 69 6e 65 | 73 20 74 68 65 0a 70 72 |etermine|s the.pr|
|000033a0| 69 76 69 6c 65 67 65 73 | 20 74 68 61 74 20 61 70 |ivileges| that ap|
|000033b0| 70 6c 79 2c 20 61 73 20 | 64 65 73 63 72 69 62 65 |ply, as |describe|
|000033c0| 64 20 6c 61 74 65 72 20 | 69 6e 20 74 68 69 73 20 |d later |in this |
|000033d0| 73 65 63 74 69 6f 6e 2e | 0a 0a 74 72 69 67 67 65 |section.|..trigge|
|000033e0| 72 5f 74 69 6d 65 20 69 | 73 20 74 68 65 20 74 72 |r_time i|s the tr|
|000033f0| 69 67 67 65 72 20 61 63 | 74 69 6f 6e 20 74 69 6d |igger ac|tion tim|
|00003400| 65 2e 20 49 74 20 63 61 | 6e 20 62 65 20 42 45 46 |e. It ca|n be BEF|
|00003410| 4f 52 45 20 6f 72 20 41 | 46 54 45 52 20 74 6f 0a |ORE or A|FTER to.|
|00003420| 69 6e 64 69 63 61 74 65 | 20 74 68 61 74 20 74 68 |indicate| that th|
|00003430| 65 20 74 72 69 67 67 65 | 72 20 61 63 74 69 76 61 |e trigge|r activa|
|00003440| 74 65 73 20 62 65 66 6f | 72 65 20 6f 72 20 61 66 |tes befo|re or af|
|00003450| 74 65 72 20 74 68 65 20 | 73 74 61 74 65 6d 65 6e |ter the |statemen|
|00003460| 74 20 74 68 61 74 0a 61 | 63 74 69 76 61 74 65 64 |t that.a|ctivated|
|00003470| 20 69 74 2e 0a 0a 74 72 | 69 67 67 65 72 5f 65 76 | it...tr|igger_ev|
|00003480| 65 6e 74 20 69 6e 64 69 | 63 61 74 65 73 20 74 68 |ent indi|cates th|
|00003490| 65 20 6b 69 6e 64 20 6f | 66 20 73 74 61 74 65 6d |e kind o|f statem|
|000034a0| 65 6e 74 20 74 68 61 74 | 20 61 63 74 69 76 61 74 |ent that| activat|
|000034b0| 65 73 20 74 68 65 0a 74 | 72 69 67 67 65 72 2e 20 |es the.t|rigger. |
|000034c0| 54 68 65 20 74 72 69 67 | 67 65 72 5f 65 76 65 6e |The trig|ger_even|
|000034d0| 74 20 63 61 6e 20 62 65 | 20 6f 6e 65 20 6f 66 20 |t can be| one of |
|000034e0| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 3a 0a 0a |the foll|owing:..|
|000034f0| 6f 20 49 4e 53 45 52 54 | 3a 20 54 68 65 20 74 72 |o INSERT|: The tr|
|00003500| 69 67 67 65 72 20 69 73 | 20 61 63 74 69 76 61 74 |igger is| activat|
|00003510| 65 64 20 77 68 65 6e 65 | 76 65 72 20 61 20 6e 65 |ed whene|ver a ne|
|00003520| 77 20 72 6f 77 20 69 73 | 20 69 6e 73 65 72 74 65 |w row is| inserte|
|00003530| 64 20 69 6e 74 6f 0a 20 | 20 74 68 65 20 74 61 62 |d into. | the tab|
|00003540| 6c 65 3b 20 66 6f 72 20 | 65 78 61 6d 70 6c 65 2c |le; for |example,|
|00003550| 20 74 68 72 6f 75 67 68 | 20 49 4e 53 45 52 54 2c | through| INSERT,|
|00003560| 20 4c 4f 41 44 20 44 41 | 54 41 2c 20 61 6e 64 20 | LOAD DA|TA, and |
|00003570| 52 45 50 4c 41 43 45 0a | 20 20 73 74 61 74 65 6d |REPLACE.| statem|
|00003580| 65 6e 74 73 2e 0a 0a 6f | 20 55 50 44 41 54 45 3a |ents...o| UPDATE:|
|00003590| 20 54 68 65 20 74 72 69 | 67 67 65 72 20 69 73 20 | The tri|gger is |
|000035a0| 61 63 74 69 76 61 74 65 | 64 20 77 68 65 6e 65 76 |activate|d whenev|
|000035b0| 65 72 20 61 20 72 6f 77 | 20 69 73 20 6d 6f 64 69 |er a row| is modi|
|000035c0| 66 69 65 64 3b 20 66 6f | 72 0a 20 20 65 78 61 6d |fied; fo|r. exam|
|000035d0| 70 6c 65 2c 20 74 68 72 | 6f 75 67 68 20 55 50 44 |ple, thr|ough UPD|
|000035e0| 41 54 45 20 73 74 61 74 | 65 6d 65 6e 74 73 2e 0a |ATE stat|ements..|
|000035f0| 0a 6f 20 44 45 4c 45 54 | 45 3a 20 54 68 65 20 74 |.o DELET|E: The t|
|00003600| 72 69 67 67 65 72 20 69 | 73 20 61 63 74 69 76 61 |rigger i|s activa|
|00003610| 74 65 64 20 77 68 65 6e | 65 76 65 72 20 61 20 72 |ted when|ever a r|
|00003620| 6f 77 20 69 73 20 64 65 | 6c 65 74 65 64 20 66 72 |ow is de|leted fr|
|00003630| 6f 6d 20 74 68 65 0a 20 | 20 74 61 62 6c 65 3b 20 |om the. | table; |
|00003640| 66 6f 72 20 65 78 61 6d | 70 6c 65 2c 20 74 68 72 |for exam|ple, thr|
|00003650| 6f 75 67 68 20 44 45 4c | 45 54 45 20 61 6e 64 20 |ough DEL|ETE and |
|00003660| 52 45 50 4c 41 43 45 20 | 73 74 61 74 65 6d 65 6e |REPLACE |statemen|
|00003670| 74 73 2e 20 48 6f 77 65 | 76 65 72 2c 0a 20 20 44 |ts. Howe|ver,. D|
|00003680| 52 4f 50 20 54 41 42 4c | 45 20 61 6e 64 20 54 52 |ROP TABL|E and TR|
|00003690| 55 4e 43 41 54 45 20 73 | 74 61 74 65 6d 65 6e 74 |UNCATE s|tatement|
|000036a0| 73 20 6f 6e 20 74 68 65 | 20 74 61 62 6c 65 20 64 |s on the| table d|
|000036b0| 6f 20 6e 6f 74 20 61 63 | 74 69 76 61 74 65 20 74 |o not ac|tivate t|
|000036c0| 68 69 73 0a 20 20 74 72 | 69 67 67 65 72 2c 20 62 |his. tr|igger, b|
|000036d0| 65 63 61 75 73 65 20 74 | 68 65 79 20 64 6f 20 6e |ecause t|hey do n|
|000036e0| 6f 74 20 75 73 65 20 44 | 45 4c 45 54 45 2e 20 53 |ot use D|ELETE. S|
|000036f0| 65 65 20 5b 48 45 4c 50 | 20 54 52 55 4e 43 41 54 |ee [HELP| TRUNCAT|
|00003700| 45 20 54 41 42 4c 45 5d | 2e 0a 0a 55 52 4c 3a 20 |E TABLE]|...URL: |
|00003710| 68 74 74 70 3a 2f 2f 64 | 65 76 2e 6d 79 73 71 6c |http://d|ev.mysql|
|00003720| 2e 63 6f 6d 2f 64 6f 63 | 2f 72 65 66 6d 61 6e 2f |.com/doc|/refman/|
|00003730| 35 2e 30 2f 65 6e 2f 63 | 72 65 61 74 65 2d 74 72 |5.0/en/c|reate-tr|
|00003740| 69 67 67 65 72 2e 68 74 | 6d 6c 0a 0a 3a 68 74 74 |igger.ht|ml..:htt|
|00003750| 70 3a 2f 2f 64 65 76 2e | 6d 79 73 71 6c 2e 63 6f |p://dev.|mysql.co|
|00003760| 6d 2f 64 6f 63 2f 72 65 | 66 6d 61 6e 2f 35 2e 30 |m/doc/re|fman/5.0|
|00003770| 2f 65 6e 2f 63 72 65 61 | 74 65 2d 74 72 69 67 67 |/en/crea|te-trigg|
|00003780| 65 72 2e 68 74 6d 6c 00 | 03 04 a4 00 32 11 00 00 |er.html.|....2...|
|00003790| 00 0c 53 48 4f 57 20 43 | 4f 4c 55 4d 4e 53 18 00 |..SHOW C|OLUMNS..|
|000037a0| 55 04 53 79 6e 74 61 78 | 3a 0a 53 48 4f 57 20 5b |U.Syntax|:.SHOW [|
|000037b0| 46 55 4c 4c 5d 20 43 4f | 4c 55 4d 4e 53 20 46 52 |FULL] CO|LUMNS FR|
|000037c0| 4f 4d 20 74 62 6c 5f 6e | 61 6d 65 20 5b 46 52 4f |OM tbl_n|ame [FRO|
|000037d0| 4d 20 64 62 5f 6e 61 6d | 65 5d 20 5b 4c 49 4b 45 |M db_nam|e] [LIKE|
|000037e0| 20 27 70 61 74 74 65 72 | 6e 27 5d 0a 0a 53 48 4f | 'patter|n']..SHO|
|000037f0| 57 20 43 4f 4c 55 4d 4e | 53 20 64 69 73 70 6c 61 |W COLUMN|S displa|
|00003800| 79 73 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 61 |ys infor|mation a|
|00003810| 62 6f 75 74 20 74 68 65 | 20 63 6f 6c 75 6d 6e 73 |bout the| columns|
|00003820| 20 69 6e 20 61 20 67 69 | 76 65 6e 20 74 61 62 6c | in a gi|ven tabl|
|00003830| 65 2e 0a 49 74 20 61 6c | 73 6f 20 77 6f 72 6b 73 |e..It al|so works|
|00003840| 20 66 6f 72 20 76 69 65 | 77 73 20 61 73 20 6f 66 | for vie|ws as of|
|00003850| 20 4d 79 53 51 4c 20 35 | 2e 30 2e 31 2e 0a 0a 49 | MySQL 5|.0.1...I|
|00003860| 66 20 74 68 65 20 64 61 | 74 61 20 74 79 70 65 73 |f the da|ta types|
|00003870| 20 64 69 66 66 65 72 20 | 66 72 6f 6d 20 77 68 61 | differ |from wha|
|00003880| 74 20 79 6f 75 20 65 78 | 70 65 63 74 20 74 68 65 |t you ex|pect the|
|00003890| 6d 20 74 6f 20 62 65 20 | 62 61 73 65 64 20 6f 6e |m to be |based on|
|000038a0| 20 79 6f 75 72 0a 43 52 | 45 41 54 45 20 54 41 42 | your.CR|EATE TAB|
|000038b0| 4c 45 20 73 74 61 74 65 | 6d 65 6e 74 2c 20 6e 6f |LE state|ment, no|
|000038c0| 74 65 20 74 68 61 74 20 | 4d 79 53 51 4c 20 73 6f |te that |MySQL so|
|000038d0| 6d 65 74 69 6d 65 73 20 | 63 68 61 6e 67 65 73 20 |metimes |changes |
|000038e0| 64 61 74 61 20 74 79 70 | 65 73 0a 77 68 65 6e 20 |data typ|es.when |
|000038f0| 79 6f 75 20 63 72 65 61 | 74 65 20 6f 72 20 61 6c |you crea|te or al|
|00003900| 74 65 72 20 61 20 74 61 | 62 6c 65 2e 20 54 68 65 |ter a ta|ble. The|
|00003910| 20 63 6f 6e 64 69 74 69 | 6f 6e 73 20 66 6f 72 20 | conditi|ons for |
|00003920| 77 68 69 63 68 20 74 68 | 69 73 20 6f 63 63 75 72 |which th|is occur|
|00003930| 73 0a 61 72 65 20 64 65 | 73 63 72 69 62 65 64 20 |s.are de|scribed |
|00003940| 69 6e 0a 68 74 74 70 3a | 2f 2f 64 65 76 2e 6d 79 |in.http:|//dev.my|
|00003950| 73 71 6c 2e 63 6f 6d 2f | 64 6f 63 2f 72 65 66 6d |sql.com/|doc/refm|
|00003960| 61 6e 2f 35 2e 30 2f 65 | 6e 2f 73 69 6c 65 6e 74 |an/5.0/e|n/silent|
|00003970| 2d 63 6f 6c 75 6d 6e 2d | 63 68 61 6e 67 65 73 2e |-column-|changes.|
|00003980| 68 74 6d 6c 2e 0a 0a 54 | 68 65 20 46 55 4c 4c 20 |html...T|he FULL |
|00003990| 6b 65 79 77 6f 72 64 20 | 63 61 75 73 65 73 20 74 |keyword |causes t|
|000039a0| 68 65 20 6f 75 74 70 75 | 74 20 74 6f 20 69 6e 63 |he outpu|t to inc|
|000039b0| 6c 75 64 65 20 74 68 65 | 20 70 72 69 76 69 6c 65 |lude the| privile|
|000039c0| 67 65 73 20 79 6f 75 20 | 68 61 76 65 0a 61 73 20 |ges you |have.as |
|000039d0| 77 65 6c 6c 20 61 73 20 | 61 6e 79 20 70 65 72 2d |well as |any per-|
|000039e0| 63 6f 6c 75 6d 6e 20 63 | 6f 6d 6d 65 6e 74 73 20 |column c|omments |
|000039f0| 66 6f 72 20 65 61 63 68 | 20 63 6f 6c 75 6d 6e 2e |for each| column.|
|00003a00| 0a 0a 59 6f 75 20 63 61 | 6e 20 75 73 65 20 64 62 |..You ca|n use db|
|00003a10| 5f 6e 61 6d 65 2e 74 62 | 6c 5f 6e 61 6d 65 20 61 |_name.tb|l_name a|
|00003a20| 73 20 61 6e 20 61 6c 74 | 65 72 6e 61 74 69 76 65 |s an alt|ernative|
|00003a30| 20 74 6f 20 74 68 65 20 | 74 62 6c 5f 6e 61 6d 65 | to the |tbl_name|
|00003a40| 20 46 52 4f 4d 0a 64 62 | 5f 6e 61 6d 65 20 73 79 | FROM.db|_name sy|
|00003a50| 6e 74 61 78 2e 20 49 6e | 20 6f 74 68 65 72 20 77 |ntax. In| other w|
|00003a60| 6f 72 64 73 2c 20 74 68 | 65 73 65 20 74 77 6f 20 |ords, th|ese two |
|00003a70| 73 74 61 74 65 6d 65 6e | 74 73 20 61 72 65 20 65 |statemen|ts are e|
|00003a80| 71 75 69 76 61 6c 65 6e | 74 3a 0a 0a 6d 79 73 71 |quivalen|t:..mysq|
|00003a90| 6c 3e 20 53 48 4f 57 20 | 43 4f 4c 55 4d 4e 53 20 |l> SHOW |COLUMNS |
|00003aa0| 46 52 4f 4d 20 6d 79 74 | 61 62 6c 65 20 46 52 4f |FROM myt|able FRO|
|00003ab0| 4d 20 6d 79 64 62 3b 0a | 6d 79 73 71 6c 3e 20 53 |M mydb;.|mysql> S|
|00003ac0| 48 4f 57 20 43 4f 4c 55 | 4d 4e 53 20 46 52 4f 4d |HOW COLU|MNS FROM|
|00003ad0| 20 6d 79 64 62 2e 6d 79 | 74 61 62 6c 65 3b 0a 0a | mydb.my|table;..|
|00003ae0| 53 48 4f 57 20 46 49 45 | 4c 44 53 20 69 73 20 61 |SHOW FIE|LDS is a|
|00003af0| 20 73 79 6e 6f 6e 79 6d | 20 66 6f 72 20 53 48 4f | synonym| for SHO|
|00003b00| 57 20 43 4f 4c 55 4d 4e | 53 2e 20 59 6f 75 20 63 |W COLUMN|S. You c|
|00003b10| 61 6e 20 61 6c 73 6f 20 | 6c 69 73 74 20 61 20 74 |an also |list a t|
|00003b20| 61 62 6c 65 27 73 0a 63 | 6f 6c 75 6d 6e 73 20 77 |able's.c|olumns w|
|00003b30| 69 74 68 20 74 68 65 20 | 6d 79 73 71 6c 73 68 6f |ith the |mysqlsho|
|00003b40| 77 20 64 62 5f 6e 61 6d | 65 20 74 62 6c 5f 6e 61 |w db_nam|e tbl_na|
|00003b50| 6d 65 20 63 6f 6d 6d 61 | 6e 64 2e 0a 0a 54 68 65 |me comma|nd...The|
|00003b60| 20 44 45 53 43 52 49 42 | 45 20 73 74 61 74 65 6d | DESCRIB|E statem|
|00003b70| 65 6e 74 20 70 72 6f 76 | 69 64 65 73 20 69 6e 66 |ent prov|ides inf|
|00003b80| 6f 72 6d 61 74 69 6f 6e | 20 73 69 6d 69 6c 61 72 |ormation| similar|
|00003b90| 20 74 6f 20 53 48 4f 57 | 20 43 4f 4c 55 4d 4e 53 | to SHOW| COLUMNS|
|00003ba0| 2e 0a 53 65 65 20 5b 48 | 45 4c 50 20 44 45 53 43 |..See [H|ELP DESC|
|00003bb0| 52 49 42 45 5d 2e 0a 0a | 55 52 4c 3a 20 68 74 74 |RIBE]...|URL: htt|
|00003bc0| 70 3a 2f 2f 64 65 76 2e | 6d 79 73 71 6c 2e 63 6f |p://dev.|mysql.co|
|00003bd0| 6d 2f 64 6f 63 2f 72 65 | 66 6d 61 6e 2f 35 2e 30 |m/doc/re|fman/5.0|
|00003be0| 2f 65 6e 2f 73 68 6f 77 | 2d 63 6f 6c 75 6d 6e 73 |/en/show|-columns|
|00003bf0| 2e 68 74 6d 6c 0a 0a 38 | 68 74 74 70 3a 2f 2f 64 |.html..8|http://d|
|00003c00| 65 76 2e 6d 79 73 71 6c | 2e 63 6f 6d 2f 64 6f 63 |ev.mysql|.com/doc|
|00003c10| 2f 72 65 66 6d 61 6e 2f | 35 2e 30 2f 65 6e 2f 73 |/refman/|5.0/en/s|
|00003c20| 68 6f 77 2d 63 6f 6c 75 | 6d 6e 73 2e 68 74 6d 6c |how-colu|mns.html|
|00003c30| 03 01 17 01 22 12 00 00 | 00 05 4d 4f 4e 54 48 1c |...."...|..MONTH.|
|00003c40| 00 92 00 53 79 6e 74 61 | 78 3a 0a 4d 4f 4e 54 48 |...Synta|x:.MONTH|
|00003c50| 28 64 61 74 65 29 0a 0a | 52 65 74 75 72 6e 73 20 |(date)..|Returns |
|00003c60| 74 68 65 20 6d 6f 6e 74 | 68 20 66 6f 72 20 64 61 |the mont|h for da|
|00003c70| 74 65 2c 20 69 6e 20 74 | 68 65 20 72 61 6e 67 65 |te, in t|he range|
|00003c80| 20 30 20 74 6f 20 31 32 | 2e 0a 0a 55 52 4c 3a 20 | 0 to 12|...URL: |
|00003c90| 68 74 74 70 3a 2f 2f 64 | 65 76 2e 6d 79 73 71 6c |http://d|ev.mysql|
|00003ca0| 2e 63 6f 6d 2f 64 6f 63 | 2f 72 65 66 6d 61 6e 2f |.com/doc|/refman/|
|00003cb0| 35 2e 30 2f 65 6e 2f 64 | 61 74 65 2d 61 6e 64 2d |5.0/en/d|ate-and-|
|00003cc0| 74 69 6d 65 2d 66 75 6e | 63 74 69 6f 6e 73 2e 68 |time-fun|ctions.h|
|00003cd0| 74 6d 6c 0a 0a 30 00 6d | 79 73 71 6c 3e 20 53 45 |tml..0.m|ysql> SE|
|00003ce0| 4c 45 43 54 20 4d 4f 4e | 54 48 28 27 31 39 39 38 |LECT MON|TH('1998|
|00003cf0| 2d 30 32 2d 30 33 27 29 | 3b 0a 20 20 20 20 20 20 |-02-03')|;. |
|00003d00| 20 20 2d 3e 20 32 0a 43 | 68 74 74 70 3a 2f 2f 64 | -> 2.C|http://d|
|00003d10| 65 76 2e 6d 79 73 71 6c | 2e 63 6f 6d 2f 64 6f 63 |ev.mysql|.com/doc|
|00003d20| 2f 72 65 66 6d 61 6e 2f | 35 2e 30 2f 65 6e 2f 64 |/refman/|5.0/en/d|
|00003d30| 61 74 65 2d 61 6e 64 2d | 74 69 6d 65 2d 66 75 6e |ate-and-|time-fun|
|00003d40| 63 74 69 6f 6e 73 2e 68 | 74 6d 6c 00 03 01 17 01 |ctions.h|tml.....|
|00003d50| 32 13 00 00 00 07 54 49 | 4e 59 49 4e 54 14 00 c4 |2.....TI|NYINT...|
|00003d60| 00 54 49 4e 59 49 4e 54 | 5b 28 4d 29 5d 20 5b 55 |.TINYINT|[(M)] [U|
|00003d70| 4e 53 49 47 4e 45 44 5d | 20 5b 5a 45 52 4f 46 49 |NSIGNED]| [ZEROFI|
|00003d80| 4c 4c 5d 0a 0a 41 20 76 | 65 72 79 20 73 6d 61 6c |LL]..A v|ery smal|
|00003d90| 6c 20 69 6e 74 65 67 65 | 72 2e 20 54 68 65 20 73 |l intege|r. The s|
|00003da0| 69 67 6e 65 64 20 72 61 | 6e 67 65 20 69 73 20 2d |igned ra|nge is -|
|00003db0| 31 32 38 20 74 6f 20 31 | 32 37 2e 20 54 68 65 20 |128 to 1|27. The |
|00003dc0| 75 6e 73 69 67 6e 65 64 | 0a 72 61 6e 67 65 20 69 |unsigned|.range i|
|00003dd0| 73 20 30 20 74 6f 20 32 | 35 35 2e 0a 0a 55 52 4c |s 0 to 2|55...URL|
|00003de0| 3a 20 68 74 74 70 3a 2f | 2f 64 65 76 2e 6d 79 73 |: http:/|/dev.mys|
|00003df0| 71 6c 2e 63 6f 6d 2f 64 | 6f 63 2f 72 65 66 6d 61 |ql.com/d|oc/refma|
|00003e00| 6e 2f 35 2e 30 2f 65 6e | 2f 6e 75 6d 65 72 69 63 |n/5.0/en|/numeric|
|00003e10| 2d 74 79 70 65 2d 6f 76 | 65 72 76 69 65 77 2e 68 |-type-ov|erview.h|
|00003e20| 74 6d 6c 0a 0a 41 68 74 | 74 70 3a 2f 2f 64 65 76 |tml..Aht|tp://dev|
|00003e30| 2e 6d 79 73 71 6c 2e 63 | 6f 6d 2f 64 6f 63 2f 72 |.mysql.c|om/doc/r|
|00003e40| 65 66 6d 61 6e 2f 35 2e | 30 2f 65 6e 2f 6e 75 6d |efman/5.|0/en/num|
|00003e50| 65 72 69 63 2d 74 79 70 | 65 2d 6f 76 65 72 76 69 |eric-typ|e-overvi|
|00003e60| 65 77 2e 68 74 6d 6c 00 | 03 02 fb 01 32 14 00 00 |ew.html.|....2...|
|00003e70| 00 0d 53 48 4f 57 20 54 | 52 49 47 47 45 52 53 18 |..SHOW T|RIGGERS.|
|00003e80| 00 aa 02 53 79 6e 74 61 | 78 3a 0a 53 48 4f 57 20 |...Synta|x:.SHOW |
|00003e90| 54 52 49 47 47 45 52 53 | 20 5b 46 52 4f 4d 20 64 |TRIGGERS| [FROM d|
|00003ea0| 62 5f 6e 61 6d 65 5d 20 | 5b 4c 49 4b 45 20 65 78 |b_name] |[LIKE ex|
|00003eb0| 70 72 5d 0a 0a 53 48 4f | 57 20 54 52 49 47 47 45 |pr]..SHO|W TRIGGE|
|00003ec0| 52 53 20 6c 69 73 74 73 | 20 74 68 65 20 74 72 69 |RS lists| the tri|
|00003ed0| 67 67 65 72 73 20 63 75 | 72 72 65 6e 74 6c 79 20 |ggers cu|rrently |
|00003ee0| 64 65 66 69 6e 65 64 20 | 6f 6e 20 74 68 65 20 4d |defined |on the M|
|00003ef0| 79 53 51 4c 20 73 65 72 | 76 65 72 2e 0a 54 68 69 |ySQL ser|ver..Thi|
|00003f00| 73 20 73 74 61 74 65 6d | 65 6e 74 20 72 65 71 75 |s statem|ent requ|
|00003f10| 69 72 65 73 20 74 68 65 | 20 53 55 50 45 52 20 70 |ires the| SUPER p|
|00003f20| 72 69 76 69 6c 65 67 65 | 2e 20 49 74 20 77 61 73 |rivilege|. It was|
|00003f30| 20 69 6d 70 6c 65 6d 65 | 6e 74 65 64 20 69 6e 0a | impleme|nted in.|
|00003f40| 4d 79 53 51 4c 20 35 2e | 30 2e 31 30 2e 0a 0a 46 |MySQL 5.|0.10...F|
|00003f50| 6f 72 20 74 68 65 20 74 | 72 69 67 67 65 72 20 69 |or the t|rigger i|
|00003f60| 6e 73 5f 73 75 6d 20 61 | 73 20 64 65 66 69 6e 65 |ns_sum a|s define|
|00003f70| 64 20 69 6e 0a 68 74 74 | 70 3a 2f 2f 64 65 76 2e |d in.htt|p://dev.|
|00003f80| 6d 79 73 71 6c 2e 63 6f | 6d 2f 64 6f 63 2f 72 65 |mysql.co|m/doc/re|
|00003f90| 66 6d 61 6e 2f 35 2e 30 | 2f 65 6e 2f 75 73 69 6e |fman/5.0|/en/usin|
|00003fa0| 67 2d 74 72 69 67 67 65 | 72 73 2e 68 74 6d 6c 2c |g-trigge|rs.html,|
|00003fb0| 20 74 68 65 20 6f 75 74 | 70 75 74 0a 6f 66 20 74 | the out|put.of t|
|00003fc0| 68 69 73 20 73 74 61 74 | 65 6d 65 6e 74 20 69 73 |his stat|ement is|
|00003fd0| 20 61 73 20 73 68 6f 77 | 6e 20 68 65 72 65 3a 0a | as show|n here:.|
|00003fe0| 0a 6d 79 73 71 6c 3e 20 | 53 48 4f 57 20 54 52 49 |.mysql> |SHOW TRI|
|00003ff0| 47 47 45 52 53 20 4c 49 | 4b 45 20 27 61 63 63 25 |GGERS LI|KE 'acc%|
|00004000| 27 5c 47 0a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |'\G.****|********|
|00004010| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 20 |********|******* |
|00004020| 31 2e 20 72 6f 77 20 2a | 2a 2a 2a 2a 2a 2a 2a 2a |1. row *|********|
|00004030| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004040| 2a 2a 0a 20 20 54 72 69 | 67 67 65 72 3a 20 69 6e |**. Tri|gger: in|
|00004050| 73 5f 73 75 6d 0a 20 20 | 20 20 45 76 65 6e 74 3a |s_sum. | Event:|
|00004060| 20 49 4e 53 45 52 54 0a | 20 20 20 20 54 61 62 6c | INSERT.| Tabl|
|00004070| 65 3a 20 61 63 63 6f 75 | 6e 74 0a 53 74 61 74 65 |e: accou|nt.State|
|00004080| 6d 65 6e 74 3a 20 53 45 | 54 20 40 73 75 6d 20 3d |ment: SE|T @sum =|
|00004090| 20 40 73 75 6d 20 2b 20 | 4e 45 57 2e 61 6d 6f 75 | @sum + |NEW.amou|
|000040a0| 6e 74 0a 20 20 20 54 69 | 6d 69 6e 67 3a 20 42 45 |nt. Ti|ming: BE|
|000040b0| 46 4f 52 45 0a 20 20 43 | 72 65 61 74 65 64 3a 20 |FORE. C|reated: |
|000040c0| 4e 55 4c 4c 0a 20 73 71 | 6c 5f 6d 6f 64 65 3a 0a |NULL. sq|l_mode:.|
|000040d0| 20 20 44 65 66 69 6e 65 | 72 3a 20 6d 79 6e 61 6d | Define|r: mynam|
|000040e0| 65 40 6c 6f 63 61 6c 68 | 6f 73 74 0a 0a 55 52 4c |e@localh|ost..URL|
|000040f0| 3a 20 68 74 74 70 3a 2f | 2f 64 65 76 2e 6d 79 73 |: http:/|/dev.mys|
|00004100| 71 6c 2e 63 6f 6d 2f 64 | 6f 63 2f 72 65 66 6d 61 |ql.com/d|oc/refma|
|00004110| 6e 2f 35 2e 30 2f 65 6e | 2f 73 68 6f 77 2d 74 72 |n/5.0/en|/show-tr|
|00004120| 69 67 67 65 72 73 2e 68 | 74 6d 6c 0a 0a 39 68 74 |iggers.h|tml..9ht|
|00004130| 74 70 3a 2f 2f 64 65 76 | 2e 6d 79 73 71 6c 2e 63 |tp://dev|.mysql.c|
|00004140| 6f 6d 2f 64 6f 63 2f 72 | 65 66 6d 61 6e 2f 35 2e |om/doc/r|efman/5.|
|00004150| 30 2f 65 6e 2f 73 68 6f | 77 2d 74 72 69 67 67 65 |0/en/sho|w-trigge|
|00004160| 72 73 2e 68 74 6d 6c 00 | 03 04 2e 02 32 15 00 00 |rs.html.|....2...|
|00004170| 00 0f 4d 41 53 54 45 52 | 5f 50 4f 53 5f 57 41 49 |..MASTER|_POS_WAI|
|00004180| 54 0d 00 d1 03 53 79 6e | 74 61 78 3a 0a 4d 41 53 |T....Syn|tax:.MAS|
|00004190| 54 45 52 5f 50 4f 53 5f | 57 41 49 54 28 6c 6f 67 |TER_POS_|WAIT(log|
|000041a0| 5f 6e 61 6d 65 2c 6c 6f | 67 5f 70 6f 73 5b 2c 74 |_name,lo|g_pos[,t|
|000041b0| 69 6d 65 6f 75 74 5d 29 | 0a 0a 54 68 69 73 20 66 |imeout])|..This f|
|000041c0| 75 6e 63 74 69 6f 6e 20 | 69 73 20 75 73 65 66 75 |unction |is usefu|
|000041d0| 6c 20 66 6f 72 20 63 6f | 6e 74 72 6f 6c 20 6f 66 |l for co|ntrol of|
|000041e0| 20 6d 61 73 74 65 72 2f | 73 6c 61 76 65 20 73 79 | master/|slave sy|
|000041f0| 6e 63 68 72 6f 6e 69 7a | 61 74 69 6f 6e 2e 20 49 |nchroniz|ation. I|
|00004200| 74 0a 62 6c 6f 63 6b 73 | 20 75 6e 74 69 6c 20 74 |t.blocks| until t|
|00004210| 68 65 20 73 6c 61 76 65 | 20 68 61 73 20 72 65 61 |he slave| has rea|
|00004220| 64 20 61 6e 64 20 61 70 | 70 6c 69 65 64 20 61 6c |d and ap|plied al|
|00004230| 6c 20 75 70 64 61 74 65 | 73 20 75 70 20 74 6f 20 |l update|s up to |
|00004240| 74 68 65 0a 73 70 65 63 | 69 66 69 65 64 20 70 6f |the.spec|ified po|
|00004250| 73 69 74 69 6f 6e 20 69 | 6e 20 74 68 65 20 6d 61 |sition i|n the ma|
|00004260| 73 74 65 72 20 6c 6f 67 | 2e 20 54 68 65 20 72 65 |ster log|. The re|
|00004270| 74 75 72 6e 20 76 61 6c | 75 65 20 69 73 20 74 68 |turn val|ue is th|
|00004280| 65 20 6e 75 6d 62 65 72 | 20 6f 66 0a 6c 6f 67 20 |e number| of.log |
|00004290| 65 76 65 6e 74 73 20 74 | 68 65 20 73 6c 61 76 65 |events t|he slave|
|000042a0| 20 68 61 64 20 74 6f 20 | 77 61 69 74 20 66 6f 72 | had to |wait for|
|000042b0| 20 74 6f 20 61 64 76 61 | 6e 63 65 20 74 6f 20 74 | to adva|nce to t|
|000042c0| 68 65 20 73 70 65 63 69 | 66 69 65 64 0a 70 6f 73 |he speci|fied.pos|
|000042d0| 69 74 69 6f 6e 2e 20 54 | 68 65 20 66 75 6e 63 74 |ition. T|he funct|
|000042e0| 69 6f 6e 20 72 65 74 75 | 72 6e 73 20 4e 55 4c 4c |ion retu|rns NULL|
|000042f0| 20 69 66 20 74 68 65 20 | 73 6c 61 76 65 20 53 51 | if the |slave SQ|
|00004300| 4c 20 74 68 72 65 61 64 | 20 69 73 20 6e 6f 74 0a |L thread| is not.|
|00004310| 73 74 61 72 74 65 64 2c | 20 74 68 65 20 73 6c 61 |started,| the sla|
|00004320| 76 65 27 73 20 6d 61 73 | 74 65 72 20 69 6e 66 6f |ve's mas|ter info|
|00004330| 72 6d 61 74 69 6f 6e 20 | 69 73 20 6e 6f 74 20 69 |rmation |is not i|
|00004340| 6e 69 74 69 61 6c 69 7a | 65 64 2c 20 74 68 65 0a |nitializ|ed, the.|
|00004350| 61 72 67 75 6d 65 6e 74 | 73 20 61 72 65 20 69 6e |argument|s are in|
|00004360| 63 6f 72 72 65 63 74 2c | 20 6f 72 20 61 6e 20 65 |correct,| or an e|
|00004370| 72 72 6f 72 20 6f 63 63 | 75 72 73 2e 20 49 74 20 |rror occ|urs. It |
|00004380| 72 65 74 75 72 6e 73 20 | 2d 31 20 69 66 20 74 68 |returns |-1 if th|
|00004390| 65 0a 74 69 6d 65 6f 75 | 74 20 68 61 73 20 62 65 |e.timeou|t has be|
|000043a0| 65 6e 20 65 78 63 65 65 | 64 65 64 2e 20 49 66 20 |en excee|ded. If |
|000043b0| 74 68 65 20 73 6c 61 76 | 65 20 53 51 4c 20 74 68 |the slav|e SQL th|
|000043c0| 72 65 61 64 20 73 74 6f | 70 73 20 77 68 69 6c 65 |read sto|ps while|
|000043d0| 0a 4d 41 53 54 45 52 5f | 50 4f 53 5f 57 41 49 54 |.MASTER_|POS_WAIT|
|000043e0| 28 29 20 69 73 20 77 61 | 69 74 69 6e 67 2c 20 74 |() is wa|iting, t|
|000043f0| 68 65 20 66 75 6e 63 74 | 69 6f 6e 20 72 65 74 75 |he funct|ion retu|
|00004400| 72 6e 73 20 4e 55 4c 4c | 2e 20 49 66 20 74 68 65 |rns NULL|. If the|
|00004410| 20 73 6c 61 76 65 0a 69 | 73 20 70 61 73 74 20 74 | slave.i|s past t|
|00004420| 68 65 20 73 70 65 63 69 | 66 69 65 64 20 70 6f 73 |he speci|fied pos|
|00004430| 69 74 69 6f 6e 2c 20 74 | 68 65 20 66 75 6e 63 74 |ition, t|he funct|
|00004440| 69 6f 6e 20 72 65 74 75 | 72 6e 73 20 69 6d 6d 65 |ion retu|rns imme|
|00004450| 64 69 61 74 65 6c 79 2e | 0a 0a 49 66 20 61 20 74 |diately.|..If a t|
|00004460| 69 6d 65 6f 75 74 20 76 | 61 6c 75 65 20 69 73 20 |imeout v|alue is |
|00004470| 73 70 65 63 69 66 69 65 | 64 2c 20 4d 41 53 54 45 |specifie|d, MASTE|
|00004480| 52 5f 50 4f 53 5f 57 41 | 49 54 28 29 20 73 74 6f |R_POS_WA|IT() sto|
|00004490| 70 73 20 77 61 69 74 69 | 6e 67 20 77 68 65 6e 0a |ps waiti|ng when.|
|000044a0| 74 69 6d 65 6f 75 74 20 | 73 65 63 6f 6e 64 73 20 |timeout |seconds |
|000044b0| 68 61 76 65 20 65 6c 61 | 70 73 65 64 2e 20 74 69 |have ela|psed. ti|
|000044c0| 6d 65 6f 75 74 20 6d 75 | 73 74 20 62 65 20 67 72 |meout mu|st be gr|
|000044d0| 65 61 74 65 72 20 74 68 | 61 6e 20 30 3b 20 61 20 |eater th|an 0; a |
|000044e0| 7a 65 72 6f 20 6f 72 0a | 6e 65 67 61 74 69 76 65 |zero or.|negative|
|000044f0| 20 74 69 6d 65 6f 75 74 | 20 6d 65 61 6e 73 20 6e | timeout| means n|
|00004500| 6f 20 74 69 6d 65 6f 75 | 74 2e 0a 0a 55 52 4c 3a |o timeou|t...URL:|
|00004510| 20 68 74 74 70 3a 2f 2f | 64 65 76 2e 6d 79 73 71 | http://|dev.mysq|
|00004520| 6c 2e 63 6f 6d 2f 64 6f | 63 2f 72 65 66 6d 61 6e |l.com/do|c/refman|
|00004530| 2f 35 2e 30 2f 65 6e 2f | 6d 69 73 63 65 6c 6c 61 |/5.0/en/|miscella|
|00004540| 6e 65 6f 75 73 2d 66 75 | 6e 63 74 69 6f 6e 73 2e |neous-fu|nctions.|
|00004550| 68 74 6d 6c 0a 0a 43 68 | 74 74 70 3a 2f 2f 64 65 |html..Ch|ttp://de|
|00004560| 76 2e 6d 79 73 71 6c 2e | 63 6f 6d 2f 64 6f 63 2f |v.mysql.|com/doc/|
|00004570| 72 65 66 6d 61 6e 2f 35 | 2e 30 2f 65 6e 2f 6d 69 |refman/5|.0/en/mi|
|00004580| 73 63 65 6c 6c 61 6e 65 | 6f 75 73 2d 66 75 6e 63 |scellane|ous-func|
|00004590| 74 69 6f 6e 73 2e 68 74 | 6d 6c 00 00 01 04 e5 22 |tions.ht|ml....."|
|000045a0| 16 00 00 00 06 52 45 47 | 45 58 50 21 00 6f 03 53 |.....REG|EXP!.o.S|
|000045b0| 79 6e 74 61 78 3a 0a 65 | 78 70 72 20 52 45 47 45 |yntax:.e|xpr REGE|
|000045c0| 58 50 20 70 61 74 2c 20 | 65 78 70 72 20 52 4c 49 |XP pat, |expr RLI|
|000045d0| 4b 45 20 70 61 74 0a 0a | 50 65 72 66 6f 72 6d 73 |KE pat..|Performs|
|000045e0| 20 61 20 70 61 74 74 65 | 72 6e 20 6d 61 74 63 68 | a patte|rn match|
|000045f0| 20 6f 66 20 61 20 73 74 | 72 69 6e 67 20 65 78 70 | of a st|ring exp|
|00004600| 72 65 73 73 69 6f 6e 20 | 65 78 70 72 20 61 67 61 |ression |expr aga|
|00004610| 69 6e 73 74 20 61 20 70 | 61 74 74 65 72 6e 0a 70 |inst a p|attern.p|
|00004620| 61 74 2e 20 54 68 65 20 | 70 61 74 74 65 72 6e 20 |at. The |pattern |
|00004630| 63 61 6e 20 62 65 20 61 | 6e 20 65 78 74 65 6e 64 |can be a|n extend|
|00004640| 65 64 20 72 65 67 75 6c | 61 72 20 65 78 70 72 65 |ed regul|ar expre|
|00004650| 73 73 69 6f 6e 2e 20 54 | 68 65 20 73 79 6e 74 61 |ssion. T|he synta|
|00004660| 78 20 66 6f 72 0a 72 65 | 67 75 6c 61 72 20 65 78 |x for.re|gular ex|
|00004670| 70 72 65 73 73 69 6f 6e | 73 20 69 73 20 64 69 73 |pression|s is dis|
|00004680| 63 75 73 73 65 64 20 69 | 6e 0a 68 74 74 70 3a 2f |cussed i|n.http:/|
|00004690| 2f 64 65 76 2e 6d 79 73 | 71 6c 2e 63 6f 6d 2f 64 |/dev.mys|ql.com/d|
|000046a0| 6f 63 2f 72 65 66 6d 61 | 6e 2f 35 2e 30 2f 65 6e |oc/refma|n/5.0/en|
|000046b0| 2f 72 65 67 65 78 70 2e | 68 74 6d 6c 2e 20 52 65 |/regexp.|html. Re|
|000046c0| 74 75 72 6e 73 20 31 20 | 69 66 20 65 78 70 72 0a |turns 1 |if expr.|
|000046d0| 6d 61 74 63 68 65 73 20 | 70 61 74 3b 20 6f 74 68 |matches |pat; oth|
|000046e0| 65 72 77 69 73 65 20 69 | 74 20 72 65 74 75 72 6e |erwise i|t return|
|000046f0| 73 20 30 2e 20 49 66 20 | 65 69 74 68 65 72 20 65 |s 0. If |either e|
|00004700| 78 70 72 20 6f 72 20 70 | 61 74 20 69 73 20 4e 55 |xpr or p|at is NU|
|00004710| 4c 4c 2c 20 74 68 65 0a | 72 65 73 75 6c 74 20 69 |LL, the.|result i|
|00004720| 73 20 4e 55 4c 4c 2e 20 | 52 4c 49 4b 45 20 69 73 |s NULL. |RLIKE is|
|00004730| 20 61 20 73 79 6e 6f 6e | 79 6d 20 66 6f 72 20 52 | a synon|ym for R|
|00004740| 45 47 45 58 50 2c 20 70 | 72 6f 76 69 64 65 64 20 |EGEXP, p|rovided |
|00004750| 66 6f 72 20 6d 53 51 4c | 0a 63 6f 6d 70 61 74 69 |for mSQL|.compati|
|00004760| 62 69 6c 69 74 79 2e 0a | 0a 54 68 65 20 70 61 74 |bility..|.The pat|
|00004770| 74 65 72 6e 20 6e 65 65 | 64 20 6e 6f 74 20 62 65 |tern nee|d not be|
|00004780| 20 61 20 6c 69 74 65 72 | 61 6c 20 73 74 72 69 6e | a liter|al strin|
|00004790| 67 2e 20 46 6f 72 20 65 | 78 61 6d 70 6c 65 2c 20 |g. For e|xample, |
|000047a0| 69 74 20 63 61 6e 20 62 | 65 0a 73 70 65 63 69 66 |it can b|e.specif|
|000047b0| 69 65 64 20 61 73 20 61 | 20 73 74 72 69 6e 67 20 |ied as a| string |
|000047c0| 65 78 70 72 65 73 73 69 | 6f 6e 20 6f 72 20 74 61 |expressi|on or ta|
|000047d0| 62 6c 65 20 63 6f 6c 75 | 6d 6e 2e 0a 0a 4e 6f 74 |ble colu|mn...Not|
|000047e0| 65 3a 20 42 65 63 61 75 | 73 65 20 4d 79 53 51 4c |e: Becau|se MySQL|
|000047f0| 20 75 73 65 73 20 74 68 | 65 20 43 20 65 73 63 61 | uses th|e C esca|
|00004800| 70 65 20 73 79 6e 74 61 | 78 20 69 6e 20 73 74 72 |pe synta|x in str|
|00004810| 69 6e 67 73 20 28 66 6f | 72 20 65 78 61 6d 70 6c |ings (fo|r exampl|
|00004820| 65 2c 0a 60 5c 6e 27 20 | 74 6f 20 72 65 70 72 65 |e,.`\n' |to repre|
|00004830| 73 65 6e 74 20 74 68 65 | 20 6e 65 77 6c 69 6e 65 |sent the| newline|
|00004840| 20 63 68 61 72 61 63 74 | 65 72 29 2c 20 79 6f 75 | charact|er), you|
|00004850| 20 6d 75 73 74 20 64 6f | 75 62 6c 65 20 61 6e 79 | must do|uble any|
|00004860| 20 60 5c 27 20 74 68 61 | 74 0a 79 6f 75 20 75 73 | `\' tha|t.you us|
|00004870| 65 20 69 6e 20 79 6f 75 | 72 20 52 45 47 45 58 50 |e in you|r REGEXP|
|00004880| 20 73 74 72 69 6e 67 73 | 2e 0a 0a 52 45 47 45 58 | strings|...REGEX|
|00004890| 50 20 69 73 20 6e 6f 74 | 20 63 61 73 65 20 73 65 |P is not| case se|
|000048a0| 6e 73 69 74 69 76 65 2c | 20 65 78 63 65 70 74 20 |nsitive,| except |
|000048b0| 77 68 65 6e 20 75 73 65 | 64 20 77 69 74 68 20 62 |when use|d with b|
|000048c0| 69 6e 61 72 79 20 73 74 | 72 69 6e 67 73 2e 0a 0a |inary st|rings...|
|000048d0| 55 52 4c 3a 20 68 74 74 | 70 3a 2f 2f 64 65 76 2e |URL: htt|p://dev.|
|000048e0| 6d 79 73 71 6c 2e 63 6f | 6d 2f 64 6f 63 2f 72 65 |mysql.co|m/doc/re|
|000048f0| 66 6d 61 6e 2f 35 2e 30 | 2f 65 6e 2f 73 74 72 69 |fman/5.0|/en/stri|
|00004900| 6e 67 2d 63 6f 6d 70 61 | 72 69 73 6f 6e 2d 66 75 |ng-compa|rison-fu|
|00004910| 6e 63 74 69 6f 6e 73 2e | 68 74 6d 6c 0a 0a 1c 01 |nctions.|html....|
|00004920| 6d 79 73 71 6c 3e 20 53 | 45 4c 45 43 54 20 27 4d |mysql> S|ELECT 'M|
|00004930| 6f 6e 74 79 21 27 20 52 | 45 47 45 58 50 20 27 6d |onty!' R|EGEXP 'm|
|00004940| 25 79 25 25 27 3b 0a 20 | 20 20 20 20 20 20 20 2d |%y%%';. | -|
|00004950| 3e 20 30 0a 6d 79 73 71 | 6c 3e 20 53 45 4c 45 43 |> 0.mysq|l> SELEC|
|00004960| 54 20 27 4d 6f 6e 74 79 | 21 27 20 52 45 47 45 58 |T 'Monty|!' REGEX|
|00004970| 50 20 27 2e 2a 27 3b 0a | 20 20 20 20 20 20 20 20 |P '.*';.| |
|00004980| 2d 3e 20 31 0a 6d 79 73 | 71 6c 3e 20 53 45 4c 45 |-> 1.mys|ql> SELE|
|00004990| 43 54 20 27 6e 65 77 2a | 5c 6e 2a 6c 69 6e 65 27 |CT 'new*|\n*line'|
|000049a0| 20 52 45 47 45 58 50 20 | 27 6e 65 77 5c 5c 2a 2e | REGEXP |'new\\*.|
|000049b0| 5c 5c 2a 6c 69 6e 65 27 | 3b 0a 20 20 20 20 20 20 |\\*line'|;. |
|000049c0| 20 20 2d 3e 20 31 0a 6d | 79 73 71 6c 3e 20 53 45 | -> 1.m|ysql> SE|
|000049d0| 4c 45 43 54 20 27 61 27 | 20 52 45 47 45 58 50 20 |LECT 'a'| REGEXP |
|000049e0| 27 41 27 2c 20 27 61 27 | 20 52 45 47 45 58 50 20 |'A', 'a'| REGEXP |
|000049f0| 42 49 4e 41 52 59 20 27 | 41 27 3b 0a 20 20 20 20 |BINARY '|A';. |
|00004a00| 20 20 20 20 2d 3e 20 31 | 20 20 30 0a 6d 79 73 71 | -> 1| 0.mysq|
|00004a10| 6c 3e 20 53 45 4c 45 43 | 54 20 27 61 27 20 52 45 |l> SELEC|T 'a' RE|
|00004a20| 47 45 58 50 20 27 5e 5b | 61 2d 64 5d 27 3b 0a 20 |GEXP '^[|a-d]';. |
|00004a30| 20 20 20 20 20 20 20 2d | 3e 20 31 0a 47 68 74 74 | -|> 1.Ghtt|
|00004a40| 70 3a 2f 2f 64 65 76 2e | 6d 79 73 71 6c 2e 63 6f |p://dev.|mysql.co|
|00004a50| 6d 2f 64 6f 63 2f 72 65 | 66 6d 61 6e 2f 35 2e 30 |m/doc/re|fman/5.0|
|00004a60| 2f 65 6e 2f 73 74 72 69 | 6e 67 2d 63 6f 6d 70 61 |/en/stri|ng-compa|
|00004a70| 72 69 73 6f 6e 2d 66 75 | 6e 63 74 69 6f 6e 73 2e |rison-fu|nctions.|
|00004a80| 68 74 6d 6c 01 02 a1 32 | 17 00 00 00 0c 49 46 20 |html...2|.....IF |
|00004a90| 53 54 41 54 45 4d 45 4e | 54 23 00 52 02 53 79 6e |STATEMEN|T#.R.Syn|
|00004aa0| 74 61 78 3a 0a 49 46 20 | 73 65 61 72 63 68 5f 63 |tax:.IF |search_c|
|00004ab0| 6f 6e 64 69 74 69 6f 6e | 20 54 48 45 4e 20 73 74 |ondition| THEN st|
|00004ac0| 61 74 65 6d 65 6e 74 5f | 6c 69 73 74 0a 20 20 20 |atement_|list. |
|00004ad0| 20 5b 45 4c 53 45 49 46 | 20 73 65 61 72 63 68 5f | [ELSEIF| search_|
|00004ae0| 63 6f 6e 64 69 74 69 6f | 6e 20 54 48 45 4e 20 73 |conditio|n THEN s|
|00004af0| 74 61 74 65 6d 65 6e 74 | 5f 6c 69 73 74 5d 20 2e |tatement|_list] .|
|00004b00| 2e 2e 0a 20 20 20 20 5b | 45 4c 53 45 20 73 74 61 |... [|ELSE sta|
|00004b10| 74 65 6d 65 6e 74 5f 6c | 69 73 74 5d 0a 45 4e 44 |tement_l|ist].END|
|00004b20| 20 49 46 0a 0a 49 46 20 | 69 6d 70 6c 65 6d 65 6e | IF..IF |implemen|
|00004b30| 74 73 20 61 20 62 61 73 | 69 63 20 63 6f 6e 64 69 |ts a bas|ic condi|
|00004b40| 74 69 6f 6e 61 6c 20 63 | 6f 6e 73 74 72 75 63 74 |tional c|onstruct|
|00004b50| 2e 20 49 66 20 74 68 65 | 20 73 65 61 72 63 68 5f |. If the| search_|
|00004b60| 63 6f 6e 64 69 74 69 6f | 6e 0a 65 76 61 6c 75 61 |conditio|n.evalua|
|00004b70| 74 65 73 20 74 6f 20 74 | 72 75 65 2c 20 74 68 65 |tes to t|rue, the|
|00004b80| 20 63 6f 72 72 65 73 70 | 6f 6e 64 69 6e 67 20 53 | corresp|onding S|
|00004b90| 51 4c 20 73 74 61 74 65 | 6d 65 6e 74 20 6c 69 73 |QL state|ment lis|
|00004ba0| 74 20 69 73 20 65 78 65 | 63 75 74 65 64 2e 20 49 |t is exe|cuted. I|
|00004bb0| 66 0a 6e 6f 20 73 65 61 | 72 63 68 5f 63 6f 6e 64 |f.no sea|rch_cond|
|00004bc0| 69 74 69 6f 6e 20 6d 61 | 74 63 68 65 73 2c 20 74 |ition ma|tches, t|
|00004bd0| 68 65 20 73 74 61 74 65 | 6d 65 6e 74 20 6c 69 73 |he state|ment lis|
|00004be0| 74 20 69 6e 20 74 68 65 | 20 45 4c 53 45 20 63 6c |t in the| ELSE cl|
|00004bf0| 61 75 73 65 20 69 73 0a | 65 78 65 63 75 74 65 64 |ause is.|executed|
|00004c00| 2e 20 45 61 63 68 20 73 | 74 61 74 65 6d 65 6e 74 |. Each s|tatement|
|00004c10| 5f 6c 69 73 74 20 63 6f | 6e 73 69 73 74 73 20 6f |_list co|nsists o|
|00004c20| 66 20 6f 6e 65 20 6f 72 | 20 6d 6f 72 65 20 73 74 |f one or| more st|
|00004c30| 61 74 65 6d 65 6e 74 73 | 2e 0a 0a 4e 6f 74 65 3a |atements|...Note:|
|00004c40| 20 54 68 65 72 65 20 69 | 73 20 61 6c 73 6f 20 61 | There i|s also a|
|00004c50| 6e 20 49 46 28 29 20 66 | 75 6e 63 74 69 6f 6e 2c |n IF() f|unction,|
|00004c60| 20 77 68 69 63 68 20 64 | 69 66 66 65 72 73 20 66 | which d|iffers f|
|00004c70| 72 6f 6d 20 74 68 65 20 | 49 46 0a 73 74 61 74 65 |rom the |IF.state|
|00004c80| 6d 65 6e 74 20 64 65 73 | 63 72 69 62 65 64 20 68 |ment des|cribed h|
|00004c90| 65 72 65 2e 20 53 65 65 | 20 5b 48 45 4c 50 20 43 |ere. See| [HELP C|
|00004ca0| 41 53 45 20 66 75 6e 63 | 74 69 6f 6e 5d 2e 0a 0a |ASE func|tion]...|
|00004cb0| 55 52 4c 3a 20 68 74 74 | 70 3a 2f 2f 64 65 76 2e |URL: htt|p://dev.|
|00004cc0| 6d 79 73 71 6c 2e 63 6f | 6d 2f 64 6f 63 2f 72 65 |mysql.co|m/doc/re|
|00004cd0| 66 6d 61 6e 2f 35 2e 30 | 2f 65 6e 2f 69 66 2d 73 |fman/5.0|/en/if-s|
|00004ce0| 74 61 74 65 6d 65 6e 74 | 2e 68 74 6d 6c 0a 0a 38 |tatement|.html..8|
|00004cf0| 68 74 74 70 3a 2f 2f 64 | 65 76 2e 6d 79 73 71 6c |http://d|ev.mysql|
|00004d00| 2e 63 6f 6d 2f 64 6f 63 | 2f 72 65 66 6d 61 6e 2f |.com/doc|/refman/|
|00004d10| 35 2e 30 2f 65 6e 2f 69 | 66 2d 73 74 61 74 65 6d |5.0/en/i|f-statem|
|00004d20| 65 6e 74 2e 68 74 6d 6c | 03 01 07 01 22 18 00 00 |ent.html|...."...|
|00004d30| 00 01 5e 12 00 59 00 53 | 79 6e 74 61 78 3a 0a 5e |..^..Y.S|yntax:.^|
|00004d40| 0a 0a 42 69 74 77 69 73 | 65 20 58 4f 52 3a 0a 0a |..Bitwis|e XOR:..|
|00004d50| 55 52 4c 3a 20 68 74 74 | 70 3a 2f 2f 64 65 76 2e |URL: htt|p://dev.|
|00004d60| 6d 79 73 71 6c 2e 63 6f | 6d 2f 64 6f 63 2f 72 65 |mysql.co|m/doc/re|
|00004d70| 66 6d 61 6e 2f 35 2e 30 | 2f 65 6e 2f 62 69 74 2d |fman/5.0|/en/bit-|
|00004d80| 66 75 6e 63 74 69 6f 6e | 73 2e 68 74 6d 6c 0a 0a |function|s.html..|
|00004d90| 67 00 6d 79 73 71 6c 3e | 20 53 45 4c 45 43 54 20 |g.mysql>| SELECT |
|00004da0| 31 20 5e 20 31 3b 0a 20 | 20 20 20 20 20 20 20 2d |1 ^ 1;. | -|
|00004db0| 3e 20 30 0a 6d 79 73 71 | 6c 3e 20 53 45 4c 45 43 |> 0.mysq|l> SELEC|
|00004dc0| 54 20 31 20 5e 20 30 3b | 0a 20 20 20 20 20 20 20 |T 1 ^ 0;|. |
|00004dd0| 20 2d 3e 20 31 0a 6d 79 | 73 71 6c 3e 20 53 45 4c | -> 1.my|sql> SEL|
|00004de0| 45 43 54 20 31 31 20 5e | 20 33 3b 0a 20 20 20 20 |ECT 11 ^| 3;. |
|00004df0| 20 20 20 20 2d 3e 20 38 | 0a 39 68 74 74 70 3a 2f | -> 8|.9http:/|
|00004e00| 2f 64 65 76 2e 6d 79 73 | 71 6c 2e 63 6f 6d 2f 64 |/dev.mys|ql.com/d|
|00004e10| 6f 63 2f 72 65 66 6d 61 | 6e 2f 35 2e 30 2f 65 6e |oc/refma|n/5.0/en|
|00004e20| 2f 62 69 74 2d 66 75 6e | 63 74 69 6f 6e 73 2e 68 |/bit-fun|ctions.h|
|00004e30| 74 6d 6c 00 01 02 f9 32 | 19 00 00 00 09 44 52 4f |tml....2|.....DRO|
|00004e40| 50 20 56 49 45 57 24 00 | b0 02 53 79 6e 74 61 78 |P VIEW$.|..Syntax|
|00004e50| 3a 0a 44 52 4f 50 20 56 | 49 45 57 20 5b 49 46 20 |:.DROP V|IEW [IF |
|00004e60| 45 58 49 53 54 53 5d 0a | 20 20 20 20 76 69 65 77 |EXISTS].| view|
|00004e70| 5f 6e 61 6d 65 20 5b 2c | 20 76 69 65 77 5f 6e 61 |_name [,| view_na|
|00004e80| 6d 65 5d 20 2e 2e 2e 0a | 20 20 20 20 5b 52 45 53 |me] ....| [RES|
|00004e90| 54 52 49 43 54 20 7c 20 | 43 41 53 43 41 44 45 5d |TRICT | |CASCADE]|
|00004ea0| 0a 0a 44 52 4f 50 20 56 | 49 45 57 20 72 65 6d 6f |..DROP V|IEW remo|
|00004eb0| 76 65 73 20 6f 6e 65 20 | 6f 72 20 6d 6f 72 65 20 |ves one |or more |
|00004ec0| 76 69 65 77 73 2e 20 59 | 6f 75 20 6d 75 73 74 20 |views. Y|ou must |
|00004ed0| 68 61 76 65 20 74 68 65 | 20 44 52 4f 50 20 70 72 |have the| DROP pr|
|00004ee0| 69 76 69 6c 65 67 65 0a | 66 6f 72 20 65 61 63 68 |ivilege.|for each|
|00004ef0| 20 76 69 65 77 2e 20 49 | 66 20 61 6e 79 20 6f 66 | view. I|f any of|
|00004f00| 20 74 68 65 20 76 69 65 | 77 73 20 6e 61 6d 65 64 | the vie|ws named|
|00004f10| 20 69 6e 20 74 68 65 20 | 61 72 67 75 6d 65 6e 74 | in the |argument|
|00004f20| 20 6c 69 73 74 20 64 6f | 20 6e 6f 74 0a 65 78 69 | list do| not.exi|
|00004f30| 73 74 2c 20 4d 79 53 51 | 4c 20 72 65 74 75 72 6e |st, MySQ|L return|
|00004f40| 73 20 61 6e 20 65 72 72 | 6f 72 20 69 6e 64 69 63 |s an err|or indic|
|00004f50| 61 74 69 6e 67 20 62 79 | 20 6e 61 6d 65 20 77 68 |ating by| name wh|
|00004f60| 69 63 68 20 6e 6f 6e 2d | 65 78 69 73 74 69 6e 67 |ich non-|existing|
|00004f70| 0a 76 69 65 77 73 20 69 | 74 20 77 61 73 20 75 6e |.views i|t was un|
|00004f80| 61 62 6c 65 20 74 6f 20 | 64 72 6f 70 2c 20 62 75 |able to |drop, bu|
|00004f90| 74 20 69 74 20 61 6c 73 | 6f 20 64 72 6f 70 73 20 |t it als|o drops |
|00004fa0| 61 6c 6c 20 6f 66 20 74 | 68 65 20 76 69 65 77 73 |all of t|he views|
|00004fb0| 20 69 6e 20 74 68 65 0a | 6c 69 73 74 20 74 68 61 | in the.|list tha|
|00004fc0| 74 20 64 6f 20 65 78 69 | 73 74 2e 0a 0a 54 68 65 |t do exi|st...The|
|00004fd0| 20 49 46 20 45 58 49 53 | 54 53 20 63 6c 61 75 73 | IF EXIS|TS claus|
|00004fe0| 65 20 70 72 65 76 65 6e | 74 73 20 61 6e 20 65 72 |e preven|ts an er|
|00004ff0| 72 6f 72 20 66 72 6f 6d | 20 6f 63 63 75 72 72 69 |ror from| occurri|
|00005000| 6e 67 20 66 6f 72 20 76 | 69 65 77 73 20 74 68 61 |ng for v|iews tha|
|00005010| 74 0a 64 6f 6e 27 74 20 | 65 78 69 73 74 2e 20 57 |t.don't |exist. W|
|00005020| 68 65 6e 20 74 68 69 73 | 20 63 6c 61 75 73 65 20 |hen this| clause |
|00005030| 69 73 20 67 69 76 65 6e | 2c 20 61 20 4e 4f 54 45 |is given|, a NOTE|
|00005040| 20 69 73 20 67 65 6e 65 | 72 61 74 65 64 20 66 6f | is gene|rated fo|
|00005050| 72 20 65 61 63 68 0a 6e | 6f 6e 2d 65 78 69 73 74 |r each.n|on-exist|
|00005060| 65 6e 74 20 76 69 65 77 | 2e 20 53 65 65 20 5b 48 |ent view|. See [H|
|00005070| 45 4c 50 20 53 48 4f 57 | 20 57 41 52 4e 49 4e 47 |ELP SHOW| WARNING|
|00005080| 53 5d 2e 0a 0a 52 45 53 | 54 52 49 43 54 20 61 6e |S]...RES|TRICT an|
|00005090| 64 20 43 41 53 43 41 44 | 45 2c 20 69 66 20 67 69 |d CASCAD|E, if gi|
|000050a0| 76 65 6e 2c 20 61 72 65 | 20 70 61 72 73 65 64 20 |ven, are| parsed |
|000050b0| 61 6e 64 20 69 67 6e 6f | 72 65 64 2e 0a 0a 55 52 |and igno|red...UR|
|000050c0| 4c 3a 20 68 74 74 70 3a | 2f 2f 64 65 76 2e 6d 79 |L: http:|//dev.my|
|000050d0| 73 71 6c 2e 63 6f 6d 2f | 64 6f 63 2f 72 65 66 6d |sql.com/|doc/refm|
|000050e0| 61 6e 2f 35 2e 30 2f 65 | 6e 2f 64 72 6f 70 2d 76 |an/5.0/e|n/drop-v|
|000050f0| 69 65 77 2e 68 74 6d 6c | 0a 0a 35 68 74 74 70 3a |iew.html|..5http:|
|00005100| 2f 2f 64 65 76 2e 6d 79 | 73 71 6c 2e 63 6f 6d 2f |//dev.my|sql.com/|
|00005110| 64 6f 63 2f 72 65 66 6d | 61 6e 2f 35 2e 30 2f 65 |doc/refm|an/5.0/e|
|00005120| 6e 2f 64 72 6f 70 2d 76 | 69 65 77 2e 68 74 6d 6c |n/drop-v|iew.html|
|00005130| 03 01 6a 02 32 1a 00 00 | 00 06 57 49 54 48 49 4e |..j.2...|..WITHIN|
|00005140| 1a 00 f1 00 57 69 74 68 | 69 6e 28 67 31 2c 67 32 |....With|in(g1,g2|
|00005150| 29 0a 0a 52 65 74 75 72 | 6e 73 20 31 20 6f 72 20 |)..Retur|ns 1 or |
|00005160| 30 20 74 6f 20 69 6e 64 | 69 63 61 74 65 20 77 68 |0 to ind|icate wh|
|00005170| 65 74 68 65 72 20 67 31 | 20 69 73 20 73 70 61 74 |ether g1| is spat|
|00005180| 69 61 6c 6c 79 20 77 69 | 74 68 69 6e 20 67 32 2e |ially wi|thin g2.|
|00005190| 20 54 68 69 73 0a 74 65 | 73 74 73 20 74 68 65 20 | This.te|sts the |
|000051a0| 6f 70 70 6f 73 69 74 65 | 20 72 65 6c 61 74 69 6f |opposite| relatio|
|000051b0| 6e 73 68 69 70 20 61 73 | 20 43 6f 6e 74 61 69 6e |nship as| Contain|
|000051c0| 73 28 29 2e 0a 0a 55 52 | 4c 3a 20 68 74 74 70 3a |s()...UR|L: http:|
|000051d0| 2f 2f 64 65 76 2e 6d 79 | 73 71 6c 2e 63 6f 6d 2f |//dev.my|sql.com/|
|000051e0| 64 6f 63 2f 72 65 66 6d | 61 6e 2f 35 2e 30 2f 65 |doc/refm|an/5.0/e|
|000051f0| 6e 2f 66 75 6e 63 74 69 | 6f 6e 73 2d 74 68 61 74 |n/functi|ons-that|
|00005200| 2d 74 65 73 74 2d 73 70 | 61 74 69 61 6c 2d 72 65 |-test-sp|atial-re|
|00005210| 6c 61 74 69 6f 6e 73 68 | 69 70 73 2d 62 65 74 77 |lationsh|ips-betw|
|00005220| 65 65 6e 2d 67 65 6f 6d | 65 74 72 69 65 73 2e 68 |een-geom|etries.h|
|00005230| 74 6d 6c 0a 0a 68 68 74 | 74 70 3a 2f 2f 64 65 76 |tml..hht|tp://dev|
|00005240| 2e 6d 79 73 71 6c 2e 63 | 6f 6d 2f 64 6f 63 2f 72 |.mysql.c|om/doc/r|
|00005250| 65 66 6d 61 6e 2f 35 2e | 30 2f 65 6e 2f 66 75 6e |efman/5.|0/en/fun|
|00005260| 63 74 69 6f 6e 73 2d 74 | 68 61 74 2d 74 65 73 74 |ctions-t|hat-test|
|00005270| 2d 73 70 61 74 69 61 6c | 2d 72 65 6c 61 74 69 6f |-spatial|-relatio|
|00005280| 6e 73 68 69 70 73 2d 62 | 65 74 77 65 65 6e 2d 67 |nships-b|etween-g|
|00005290| 65 6f 6d 65 74 72 69 65 | 73 2e 68 74 6d 6c 00 00 |eometrie|s.html..|
|000052a0| 01 03 09 22 1b 00 00 00 | 04 57 45 45 4b 1c 00 f2 |..."....|.WEEK...|
|000052b0| 01 53 79 6e 74 61 78 3a | 0a 57 45 45 4b 28 64 61 |.Syntax:|.WEEK(da|
|000052c0| 74 65 5b 2c 6d 6f 64 65 | 5d 29 0a 0a 54 68 69 73 |te[,mode|])..This|
|000052d0| 20 66 75 6e 63 74 69 6f | 6e 20 72 65 74 75 72 6e | functio|n return|
|000052e0| 73 20 74 68 65 20 77 65 | 65 6b 20 6e 75 6d 62 65 |s the we|ek numbe|
|000052f0| 72 20 66 6f 72 20 64 61 | 74 65 2e 20 54 68 65 20 |r for da|te. The |
|00005300| 74 77 6f 2d 61 72 67 75 | 6d 65 6e 74 20 66 6f 72 |two-argu|ment for|
|00005310| 6d 0a 6f 66 20 57 45 45 | 4b 28 29 20 61 6c 6c 6f |m.of WEE|K() allo|
|00005320| 77 73 20 79 6f 75 20 74 | 6f 20 73 70 65 63 69 66 |ws you t|o specif|
|00005330| 79 20 77 68 65 74 68 65 | 72 20 74 68 65 20 77 65 |y whethe|r the we|
|00005340| 65 6b 20 73 74 61 72 74 | 73 20 6f 6e 20 53 75 6e |ek start|s on Sun|
|00005350| 64 61 79 20 6f 72 0a 4d | 6f 6e 64 61 79 20 61 6e |day or.M|onday an|
|00005360| 64 20 77 68 65 74 68 65 | 72 20 74 68 65 20 72 65 |d whethe|r the re|
|00005370| 74 75 72 6e 20 76 61 6c | 75 65 20 73 68 6f 75 6c |turn val|ue shoul|
|00005380| 64 20 62 65 20 69 6e 20 | 74 68 65 20 72 61 6e 67 |d be in |the rang|
|00005390| 65 20 66 72 6f 6d 20 30 | 20 74 6f 20 35 33 0a 6f |e from 0| to 53.o|
|000053a0| 72 20 66 72 6f 6d 20 31 | 20 74 6f 20 35 33 2e 20 |r from 1| to 53. |
|000053b0| 49 66 20 74 68 65 20 6d | 6f 64 65 20 61 72 67 75 |If the m|ode argu|
|000053c0| 6d 65 6e 74 20 69 73 20 | 6f 6d 69 74 74 65 64 2c |ment is |omitted,|
|000053d0| 20 74 68 65 20 76 61 6c | 75 65 20 6f 66 20 74 68 | the val|ue of th|
|000053e0| 65 0a 64 65 66 61 75 6c | 74 5f 77 65 65 6b 5f 66 |e.defaul|t_week_f|
|000053f0| 6f 72 6d 61 74 20 73 79 | 73 74 65 6d 20 76 61 72 |ormat sy|stem var|
|00005400| 69 61 62 6c 65 20 69 73 | 20 75 73 65 64 2e 20 53 |iable is| used. S|
|00005410| 65 65 0a 68 74 74 70 3a | 2f 2f 64 65 76 2e 6d 79 |ee.http:|//dev.my|
|00005420| 73 71 6c 2e 63 6f 6d 2f | 64 6f 63 2f 72 65 66 6d |sql.com/|doc/refm|
|00005430| 61 6e 2f 35 2e 30 2f 65 | 6e 2f 73 65 72 76 65 72 |an/5.0/e|n/server|
|00005440| 2d 73 79 73 74 65 6d 2d | 76 61 72 69 61 62 6c 65 |-system-|variable|
|00005450| 73 2e 68 74 6d 6c 2e 0a | 0a 55 52 4c 3a 20 68 74 |s.html..|.URL: ht|
|00005460| 74 70 3a 2f 2f 64 65 76 | 2e 6d 79 73 71 6c 2e 63 |tp://dev|.mysql.c|
|00005470| 6f 6d 2f 64 6f 63 2f 72 | 65 66 6d 61 6e 2f 35 2e |om/doc/r|efman/5.|
|00005480| 30 2f 65 6e 2f 64 61 74 | 65 2d 61 6e 64 2d 74 69 |0/en/dat|e-and-ti|
|00005490| 6d 65 2d 66 75 6e 63 74 | 69 6f 6e 73 2e 68 74 6d |me-funct|ions.htm|
|000054a0| 6c 0a 0a c3 00 6d 79 73 | 71 6c 3e 20 53 45 4c 45 |l....mys|ql> SELE|
|000054b0| 43 54 20 57 45 45 4b 28 | 27 31 39 39 38 2d 30 32 |CT WEEK(|'1998-02|
|000054c0| 2d 32 30 27 29 3b 0a 20 | 20 20 20 20 20 20 20 2d |-20');. | -|
|000054d0| 3e 20 37 0a 6d 79 73 71 | 6c 3e 20 53 45 4c 45 43 |> 7.mysq|l> SELEC|
|000054e0| 54 20 57 45 45 4b 28 27 | 31 39 39 38 2d 30 32 2d |T WEEK('|1998-02-|
|000054f0| 32 30 27 2c 30 29 3b 0a | 20 20 20 20 20 20 20 20 |20',0);.| |
|00005500| 2d 3e 20 37 0a 6d 79 73 | 71 6c 3e 20 53 45 4c 45 |-> 7.mys|ql> SELE|
|00005510| 43 54 20 57 45 45 4b 28 | 27 31 39 39 38 2d 30 32 |CT WEEK(|'1998-02|
|00005520| 2d 32 30 27 2c 31 29 3b | 0a 20 20 20 20 20 20 20 |-20',1);|. |
|00005530| 20 2d 3e 20 38 0a 6d 79 | 73 71 6c 3e 20 53 45 4c | -> 8.my|sql> SEL|
|00005540| 45 43 54 20 57 45 45 4b | 28 27 31 39 39 38 2d 31 |ECT WEEK|('1998-1|
|00005550| 32 2d 33 31 27 2c 31 29 | 3b 0a 20 20 20 20 20 20 |2-31',1)|;. |
|00005560| 20 20 2d 3e 20 35 33 0a | 43 68 74 74 70 3a 2f 2f | -> 53.|Chttp://|
|00005570| 64 65 76 2e 6d 79 73 71 | 6c 2e 63 6f 6d 2f 64 6f |dev.mysq|l.com/do|
|00005580| 63 2f 72 65 66 6d 61 6e | 2f 35 2e 30 2f 65 6e 2f |c/refman|/5.0/en/|
|00005590| 64 61 74 65 2d 61 6e 64 | 2d 74 69 6d 65 2d 66 75 |date-and|-time-fu|
|000055a0| 6e 63 74 69 6f 6e 73 2e | 68 74 6d 6c 03 04 fa 02 |nctions.|html....|
|000055b0| 32 1c 00 00 00 07 50 52 | 45 50 41 52 45 18 00 b7 |2.....PR|EPARE...|
|000055c0| 04 53 79 6e 74 61 78 3a | 0a 50 52 45 50 41 52 45 |.Syntax:|.PREPARE|
|000055d0| 20 73 74 6d 74 5f 6e 61 | 6d 65 20 46 52 4f 4d 20 | stmt_na|me FROM |
|000055e0| 70 72 65 70 61 72 61 62 | 6c 65 5f 73 74 6d 74 0a |preparab|le_stmt.|
|000055f0| 0a 54 68 65 20 50 52 45 | 50 41 52 45 20 73 74 61 |.The PRE|PARE sta|
|00005600| 74 65 6d 65 6e 74 20 70 | 72 65 70 61 72 65 73 20 |tement p|repares |
|00005610| 61 20 73 74 61 74 65 6d | 65 6e 74 20 61 6e 64 20 |a statem|ent and |
|00005620| 61 73 73 69 67 6e 73 20 | 69 74 20 61 20 6e 61 6d |assigns |it a nam|
|00005630| 65 2c 0a 73 74 6d 74 5f | 6e 61 6d 65 2c 20 62 79 |e,.stmt_|name, by|
|00005640| 20 77 68 69 63 68 20 74 | 6f 20 72 65 66 65 72 20 | which t|o refer |
|00005650| 74 6f 20 74 68 65 20 73 | 74 61 74 65 6d 65 6e 74 |to the s|tatement|
|00005660| 20 6c 61 74 65 72 2e 20 | 53 74 61 74 65 6d 65 6e | later. |Statemen|
|00005670| 74 20 6e 61 6d 65 73 0a | 61 72 65 20 6e 6f 74 20 |t names.|are not |
|00005680| 63 61 73 65 20 73 65 6e | 73 69 74 69 76 65 2e 20 |case sen|sitive. |
|00005690| 70 72 65 70 61 72 61 62 | 6c 65 5f 73 74 6d 74 20 |preparab|le_stmt |
|000056a0| 69 73 20 65 69 74 68 65 | 72 20 61 20 73 74 72 69 |is eithe|r a stri|
|000056b0| 6e 67 20 6c 69 74 65 72 | 61 6c 20 6f 72 20 61 0a |ng liter|al or a.|
|000056c0| 75 73 65 72 20 76 61 72 | 69 61 62 6c 65 20 74 68 |user var|iable th|
|000056d0| 61 74 20 63 6f 6e 74 61 | 69 6e 73 20 74 68 65 20 |at conta|ins the |
|000056e0| 74 65 78 74 20 6f 66 20 | 74 68 65 20 73 74 61 74 |text of |the stat|
|000056f0| 65 6d 65 6e 74 2e 20 54 | 68 65 20 74 65 78 74 20 |ement. T|he text |
|00005700| 6d 75 73 74 0a 72 65 70 | 72 65 73 65 6e 74 20 61 |must.rep|resent a|
|00005710| 20 73 69 6e 67 6c 65 20 | 53 51 4c 20 73 74 61 74 | single |SQL stat|
|00005720| 65 6d 65 6e 74 2c 20 6e | 6f 74 20 6d 75 6c 74 69 |ement, n|ot multi|
|00005730| 70 6c 65 20 73 74 61 74 | 65 6d 65 6e 74 73 2e 20 |ple stat|ements. |
|00005740| 57 69 74 68 69 6e 20 74 | 68 65 0a 73 74 61 74 65 |Within t|he.state|
|00005750| 6d 65 6e 74 2c 20 60 3f | 27 20 63 68 61 72 61 63 |ment, `?|' charac|
|00005760| 74 65 72 73 20 63 61 6e | 20 62 65 20 75 73 65 64 |ters can| be used|
|00005770| 20 61 73 20 70 61 72 61 | 6d 65 74 65 72 20 6d 61 | as para|meter ma|
|00005780| 72 6b 65 72 73 20 74 6f | 20 69 6e 64 69 63 61 74 |rkers to| indicat|
|00005790| 65 0a 77 68 65 72 65 20 | 64 61 74 61 20 76 61 6c |e.where |data val|
|000057a0| 75 65 73 20 61 72 65 20 | 74 6f 20 62 65 20 62 6f |ues are |to be bo|
|000057b0| 75 6e 64 20 74 6f 20 74 | 68 65 20 71 75 65 72 79 |und to t|he query|
|000057c0| 20 6c 61 74 65 72 20 77 | 68 65 6e 20 79 6f 75 20 | later w|hen you |
|000057d0| 65 78 65 63 75 74 65 0a | 69 74 2e 20 54 68 65 20 |execute.|it. The |
|000057e0| 60 3f 27 20 63 68 61 72 | 61 63 74 65 72 73 20 73 |`?' char|acters s|
|000057f0| 68 6f 75 6c 64 20 6e 6f | 74 20 62 65 20 65 6e 63 |hould no|t be enc|
|00005800| 6c 6f 73 65 64 20 77 69 | 74 68 69 6e 20 71 75 6f |losed wi|thin quo|
|00005810| 74 65 73 2c 20 65 76 65 | 6e 20 69 66 0a 79 6f 75 |tes, eve|n if.you|
|00005820| 20 69 6e 74 65 6e 64 20 | 74 6f 20 62 69 6e 64 20 | intend |to bind |
|00005830| 74 68 65 6d 20 74 6f 20 | 73 74 72 69 6e 67 20 76 |them to |string v|
|00005840| 61 6c 75 65 73 2e 20 50 | 61 72 61 6d 65 74 65 72 |alues. P|arameter|
|00005850| 20 6d 61 72 6b 65 72 73 | 20 63 61 6e 20 62 65 20 | markers| can be |
|00005860| 75 73 65 64 0a 6f 6e 6c | 79 20 77 68 65 72 65 20 |used.onl|y where |
|00005870| 64 61 74 61 20 76 61 6c | 75 65 73 20 73 68 6f 75 |data val|ues shou|
|00005880| 6c 64 20 61 70 70 65 61 | 72 2c 20 6e 6f 74 20 66 |ld appea|r, not f|
|00005890| 6f 72 20 53 51 4c 20 6b | 65 79 77 6f 72 64 73 2c |or SQL k|eywords,|
|000058a0| 0a 69 64 65 6e 74 69 66 | 69 65 72 73 2c 20 61 6e |.identif|iers, an|
|000058b0| 64 20 73 6f 20 66 6f 72 | 74 68 2e 0a 0a 49 66 20 |d so for|th...If |
|000058c0| 61 20 70 72 65 70 61 72 | 65 64 20 73 74 61 74 65 |a prepar|ed state|
|000058d0| 6d 65 6e 74 20 77 69 74 | 68 20 74 68 65 20 67 69 |ment wit|h the gi|
|000058e0| 76 65 6e 20 6e 61 6d 65 | 20 61 6c 72 65 61 64 79 |ven name| already|
|000058f0| 20 65 78 69 73 74 73 2c | 20 69 74 20 69 73 0a 64 | exists,| it is.d|
|00005900| 65 61 6c 6c 6f 63 61 74 | 65 64 20 69 6d 70 6c 69 |eallocat|ed impli|
|00005910| 63 69 74 6c 79 20 62 65 | 66 6f 72 65 20 74 68 65 |citly be|fore the|
|00005920| 20 6e 65 77 20 73 74 61 | 74 65 6d 65 6e 74 20 69 | new sta|tement i|
|00005930| 73 20 70 72 65 70 61 72 | 65 64 2e 20 54 68 69 73 |s prepar|ed. This|
|00005940| 20 6d 65 61 6e 73 0a 74 | 68 61 74 20 69 66 20 74 | means.t|hat if t|
|00005950| 68 65 20 6e 65 77 20 73 | 74 61 74 65 6d 65 6e 74 |he new s|tatement|
|00005960| 20 63 6f 6e 74 61 69 6e | 73 20 61 6e 20 65 72 72 | contain|s an err|
|00005970| 6f 72 20 61 6e 64 20 63 | 61 6e 6e 6f 74 20 62 65 |or and c|annot be|
|00005980| 20 70 72 65 70 61 72 65 | 64 2c 20 61 6e 0a 65 72 | prepare|d, an.er|
|00005990| 72 6f 72 20 69 73 20 72 | 65 74 75 72 6e 65 64 20 |ror is r|eturned |
|000059a0| 61 6e 64 20 6e 6f 20 73 | 74 61 74 65 6d 65 6e 74 |and no s|tatement|
|000059b0| 20 77 69 74 68 20 74 68 | 65 20 67 69 76 65 6e 20 | with th|e given |
|000059c0| 6e 61 6d 65 20 65 78 69 | 73 74 73 2e 0a 0a 54 68 |name exi|sts...Th|
|000059d0| 65 20 73 63 6f 70 65 20 | 6f 66 20 61 20 70 72 65 |e scope |of a pre|
|000059e0| 70 61 72 65 64 20 73 74 | 61 74 65 6d 65 6e 74 20 |pared st|atement |
|000059f0| 69 73 20 74 68 65 20 63 | 6c 69 65 6e 74 20 73 65 |is the c|lient se|
|00005a00| 73 73 69 6f 6e 20 77 69 | 74 68 69 6e 20 77 68 69 |ssion wi|thin whi|
|00005a10| 63 68 20 69 74 0a 69 73 | 20 63 72 65 61 74 65 64 |ch it.is| created|
|00005a20| 2e 20 4f 74 68 65 72 20 | 63 6c 69 65 6e 74 73 20 |. Other |clients |
|00005a30| 63 61 6e 6e 6f 74 20 73 | 65 65 20 69 74 2e 0a 0a |cannot s|ee it...|
|00005a40| 55 52 4c 3a 20 68 74 74 | 70 3a 2f 2f 64 65 76 2e |URL: htt|p://dev.|
|00005a50| 6d 79 73 71 6c 2e 63 6f | 6d 2f 64 6f 63 2f 72 65 |mysql.co|m/doc/re|
|00005a60| 66 6d 61 6e 2f 35 2e 30 | 2f 65 6e 2f 73 71 6c 70 |fman/5.0|/en/sqlp|
|00005a70| 73 2e 68 74 6d 6c 0a 0a | 31 68 74 74 70 3a 2f 2f |s.html..|1http://|
|00005a80| 64 65 76 2e 6d 79 73 71 | 6c 2e 63 6f 6d 2f 64 6f |dev.mysq|l.com/do|
|00005a90| 63 2f 72 65 66 6d 61 6e | 2f 35 2e 30 2f 65 6e 2f |c/refman|/5.0/en/|
|00005aa0| 73 71 6c 70 73 2e 68 74 | 6d 6c 00 00 03 06 87 01 |sqlps.ht|ml......|
|00005ab0| 32 1d 00 00 00 04 4c 4f | 43 4b 07 00 41 06 53 79 |2.....LO|CK..A.Sy|
|00005ac0| 6e 74 61 78 3a 0a 4c 4f | 43 4b 20 54 41 42 4c 45 |ntax:.LO|CK TABLE|
|00005ad0| 53 0a 20 20 20 20 74 62 | 6c 5f 6e 61 6d 65 20 5b |S. tb|l_name [|
|00005ae0| 41 53 20 61 6c 69 61 73 | 5d 0a 20 20 20 20 20 20 |AS alias|]. |
|00005af0| 7b 52 45 41 44 20 5b 4c | 4f 43 41 4c 5d 20 7c 20 |{READ [L|OCAL] | |
|00005b00| 5b 4c 4f 57 5f 50 52 49 | 4f 52 49 54 59 5d 20 57 |[LOW_PRI|ORITY] W|
|00005b10| 52 49 54 45 7d 0a 20 20 | 20 20 5b 2c 20 74 62 6c |RITE}. | [, tbl|
|00005b20| 5f 6e 61 6d 65 20 5b 41 | 53 20 61 6c 69 61 73 5d |_name [A|S alias]|
|00005b30| 0a 20 20 20 20 20 20 7b | 52 45 41 44 20 5b 4c 4f |. {|READ [LO|
|00005b40| 43 41 4c 5d 20 7c 20 5b | 4c 4f 57 5f 50 52 49 4f |CAL] | [|LOW_PRIO|
|00005b50| 52 49 54 59 5d 20 57 52 | 49 54 45 7d 5d 20 2e 2e |RITY] WR|ITE}] ..|
|00005b60| 2e 0a 55 4e 4c 4f 43 4b | 20 54 41 42 4c 45 53 0a |..UNLOCK| TABLES.|
|00005b70| 0a 4c 4f 43 4b 20 54 41 | 42 4c 45 53 20 6c 6f 63 |.LOCK TA|BLES loc|
|00005b80| 6b 73 20 62 61 73 65 20 | 74 61 62 6c 65 73 20 28 |ks base |tables (|
|00005b90| 62 75 74 20 6e 6f 74 20 | 76 69 65 77 73 29 20 66 |but not |views) f|
|00005ba0| 6f 72 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 74 |or the c|urrent t|
|00005bb0| 68 72 65 61 64 2e 0a 49 | 66 20 61 6e 79 20 6f 66 |hread..I|f any of|
|00005bc0| 20 74 68 65 20 74 61 62 | 6c 65 73 20 61 72 65 20 | the tab|les are |
|00005bd0| 6c 6f 63 6b 65 64 20 62 | 79 20 6f 74 68 65 72 20 |locked b|y other |
|00005be0| 74 68 72 65 61 64 73 2c | 20 69 74 20 62 6c 6f 63 |threads,| it bloc|
|00005bf0| 6b 73 20 75 6e 74 69 6c | 20 61 6c 6c 0a 6c 6f 63 |ks until| all.loc|
|00005c00| 6b 73 20 63 61 6e 20 62 | 65 20 61 63 71 75 69 72 |ks can b|e acquir|
|00005c10| 65 64 2e 0a 0a 55 4e 4c | 4f 43 4b 20 54 41 42 4c |ed...UNL|OCK TABL|
|00005c20| 45 53 20 65 78 70 6c 69 | 63 69 74 6c 79 20 72 65 |ES expli|citly re|
|00005c30| 6c 65 61 73 65 73 20 61 | 6e 79 20 6c 6f 63 6b 73 |leases a|ny locks|
|00005c40| 20 68 65 6c 64 20 62 79 | 20 74 68 65 20 63 75 72 | held by| the cur|
|00005c50| 72 65 6e 74 20 74 68 72 | 65 61 64 2e 0a 41 6c 6c |rent thr|ead..All|
|00005c60| 20 74 61 62 6c 65 73 20 | 74 68 61 74 20 61 72 65 | tables |that are|
|00005c70| 20 6c 6f 63 6b 65 64 20 | 62 79 20 74 68 65 20 63 | locked |by the c|
|00005c80| 75 72 72 65 6e 74 20 74 | 68 72 65 61 64 20 61 72 |urrent t|hread ar|
|00005c90| 65 20 69 6d 70 6c 69 63 | 69 74 6c 79 0a 75 6e 6c |e implic|itly.unl|
|00005ca0| 6f 63 6b 65 64 20 77 68 | 65 6e 20 74 68 65 20 74 |ocked wh|en the t|
|00005cb0| 68 72 65 61 64 20 69 73 | 73 75 65 73 20 61 6e 6f |hread is|sues ano|
|00005cc0| 74 68 65 72 20 4c 4f 43 | 4b 20 54 41 42 4c 45 53 |ther LOC|K TABLES|
|00005cd0| 2c 20 6f 72 20 77 68 65 | 6e 20 74 68 65 0a 63 6f |, or whe|n the.co|
|00005ce0| 6e 6e 65 63 74 69 6f 6e | 20 74 6f 20 74 68 65 20 |nnection| to the |
|00005cf0| 73 65 72 76 65 72 20 69 | 73 20 63 6c 6f 73 65 64 |server i|s closed|
|00005d00| 2e 20 55 4e 4c 4f 43 4b | 20 54 41 42 4c 45 53 20 |. UNLOCK| TABLES |
|00005d10| 69 73 20 61 6c 73 6f 20 | 75 73 65 64 20 61 66 74 |is also |used aft|
|00005d20| 65 72 0a 61 63 71 75 69 | 72 69 6e 67 20 61 20 67 |er.acqui|ring a g|
|00005d30| 6c 6f 62 61 6c 20 72 65 | 61 64 20 6c 6f 63 6b 20 |lobal re|ad lock |
|00005d40| 77 69 74 68 20 46 4c 55 | 53 48 20 54 41 42 4c 45 |with FLU|SH TABLE|
|00005d50| 53 20 57 49 54 48 20 52 | 45 41 44 20 4c 4f 43 4b |S WITH R|EAD LOCK|
|00005d60| 20 74 6f 0a 72 65 6c 65 | 61 73 65 20 74 68 61 74 | to.rele|ase that|
|00005d70| 20 6c 6f 63 6b 2e 20 28 | 59 6f 75 20 63 61 6e 20 | lock. (|You can |
|00005d80| 6c 6f 63 6b 20 61 6c 6c | 20 74 61 62 6c 65 73 20 |lock all| tables |
|00005d90| 69 6e 20 61 6c 6c 20 64 | 61 74 61 62 61 73 65 73 |in all d|atabases|
|00005da0| 20 77 69 74 68 20 72 65 | 61 64 0a 6c 6f 63 6b 73 | with re|ad.locks|
|00005db0| 20 77 69 74 68 20 74 68 | 65 20 46 4c 55 53 48 20 | with th|e FLUSH |
|00005dc0| 54 41 42 4c 45 53 20 57 | 49 54 48 20 52 45 41 44 |TABLES W|ITH READ|
|00005dd0| 20 4c 4f 43 4b 20 73 74 | 61 74 65 6d 65 6e 74 2e | LOCK st|atement.|
|00005de0| 20 53 65 65 20 5b 48 45 | 4c 50 20 46 4c 55 53 48 | See [HE|LP FLUSH|
|00005df0| 5d 2e 0a 54 68 69 73 20 | 69 73 20 61 20 76 65 72 |]..This |is a ver|
|00005e00| 79 20 63 6f 6e 76 65 6e | 69 65 6e 74 20 77 61 79 |y conven|ient way|
|00005e10| 20 74 6f 20 67 65 74 20 | 62 61 63 6b 75 70 73 20 | to get |backups |
|00005e20| 69 66 20 79 6f 75 20 68 | 61 76 65 20 61 20 66 69 |if you h|ave a fi|
|00005e30| 6c 65 73 79 73 74 65 6d | 0a 73 75 63 68 20 61 73 |lesystem|.such as|
|00005e40| 20 56 65 72 69 74 61 73 | 20 74 68 61 74 20 63 61 | Veritas| that ca|
|00005e50| 6e 20 74 61 6b 65 20 73 | 6e 61 70 73 68 6f 74 73 |n take s|napshots|
|00005e60| 20 69 6e 20 74 69 6d 65 | 2e 29 0a 0a 54 6f 20 75 | in time|.)..To u|
|00005e70| 73 65 20 4c 4f 43 4b 20 | 54 41 42 4c 45 53 2c 20 |se LOCK |TABLES, |
|00005e80| 79 6f 75 20 6d 75 73 74 | 20 68 61 76 65 20 74 68 |you must| have th|
|00005e90| 65 20 4c 4f 43 4b 20 54 | 41 42 4c 45 53 20 70 72 |e LOCK T|ABLES pr|
|00005ea0| 69 76 69 6c 65 67 65 20 | 61 6e 64 20 74 68 65 0a |ivilege |and the.|
|00005eb0| 53 45 4c 45 43 54 20 70 | 72 69 76 69 6c 65 67 65 |SELECT p|rivilege|
|00005ec0| 20 66 6f 72 20 74 68 65 | 20 69 6e 76 6f 6c 76 65 | for the| involve|
|00005ed0| 64 20 74 61 62 6c 65 73 | 2e 0a 0a 54 68 65 20 6d |d tables|...The m|
|00005ee0| 61 69 6e 20 72 65 61 73 | 6f 6e 73 20 74 6f 20 75 |ain reas|ons to u|
|00005ef0| 73 65 20 4c 4f 43 4b 20 | 54 41 42 4c 45 53 20 61 |se LOCK |TABLES a|
|00005f00| 72 65 20 74 6f 20 65 6d | 75 6c 61 74 65 20 74 72 |re to em|ulate tr|
|00005f10| 61 6e 73 61 63 74 69 6f | 6e 73 20 6f 72 20 74 6f |ansactio|ns or to|
|00005f20| 0a 67 65 74 20 6d 6f 72 | 65 20 73 70 65 65 64 20 |.get mor|e speed |
|00005f30| 77 68 65 6e 20 75 70 64 | 61 74 69 6e 67 20 74 61 |when upd|ating ta|
|00005f40| 62 6c 65 73 2e 20 54 68 | 69 73 20 69 73 20 65 78 |bles. Th|is is ex|
|00005f50| 70 6c 61 69 6e 65 64 20 | 69 6e 20 6d 6f 72 65 20 |plained |in more |
|00005f60| 64 65 74 61 69 6c 0a 6c | 61 74 65 72 2e 0a 0a 41 |detail.l|ater...A|
|00005f70| 20 74 61 62 6c 65 20 6c | 6f 63 6b 20 70 72 6f 74 | table l|ock prot|
|00005f80| 65 63 74 73 20 6f 6e 6c | 79 20 61 67 61 69 6e 73 |ects onl|y agains|
|00005f90| 74 20 69 6e 61 70 70 72 | 6f 70 72 69 61 74 65 20 |t inappr|opriate |
|00005fa0| 72 65 61 64 73 20 6f 72 | 20 77 72 69 74 65 73 20 |reads or| writes |
|00005fb0| 62 79 0a 6f 74 68 65 72 | 20 63 6c 69 65 6e 74 73 |by.other| clients|
|00005fc0| 2e 20 54 68 65 20 63 6c | 69 65 6e 74 20 68 6f 6c |. The cl|ient hol|
|00005fd0| 64 69 6e 67 20 74 68 65 | 20 6c 6f 63 6b 2c 20 65 |ding the| lock, e|
|00005fe0| 76 65 6e 20 61 20 72 65 | 61 64 20 6c 6f 63 6b 2c |ven a re|ad lock,|
|00005ff0| 20 63 61 6e 0a 70 65 72 | 66 6f 72 6d 20 74 61 62 | can.per|form tab|
|00006000| 6c 65 2d 6c 65 76 65 6c | 20 6f 70 65 72 61 74 69 |le-level| operati|
|00006010| 6f 6e 73 20 73 75 63 68 | 20 61 73 20 44 52 4f 50 |ons such| as DROP|
|00006020| 20 54 41 42 4c 45 2e 20 | 54 72 75 6e 63 61 74 65 | TABLE. |Truncate|
|00006030| 20 6f 70 65 72 61 74 69 | 6f 6e 73 0a 61 72 65 20 | operati|ons.are |
|00006040| 6e 6f 74 20 74 72 61 6e | 73 61 63 74 69 6f 6e 2d |not tran|saction-|
|00006050| 73 61 66 65 2c 20 73 6f | 20 61 6e 20 65 72 72 6f |safe, so| an erro|
|00006060| 72 20 6f 63 63 75 72 73 | 20 69 66 20 74 68 65 20 |r occurs| if the |
|00006070| 63 6c 69 65 6e 74 20 61 | 74 74 65 6d 70 74 73 20 |client a|ttempts |
|00006080| 6f 6e 65 0a 64 75 72 69 | 6e 67 20 61 6e 20 61 63 |one.duri|ng an ac|
|00006090| 74 69 76 65 20 74 72 61 | 6e 73 61 63 74 69 6f 6e |tive tra|nsaction|
|000060a0| 20 6f 72 20 77 68 69 6c | 65 20 68 6f 6c 64 69 6e | or whil|e holdin|
|000060b0| 67 20 61 20 74 61 62 6c | 65 20 6c 6f 63 6b 2e 0a |g a tabl|e lock..|
|000060c0| 0a 55 52 4c 3a 20 68 74 | 74 70 3a 2f 2f 64 65 76 |.URL: ht|tp://dev|
|000060d0| 2e 6d 79 73 71 6c 2e 63 | 6f 6d 2f 64 6f 63 2f 72 |.mysql.c|om/doc/r|
|000060e0| 65 66 6d 61 6e 2f 35 2e | 30 2f 65 6e 2f 6c 6f 63 |efman/5.|0/en/loc|
|000060f0| 6b 2d 74 61 62 6c 65 73 | 2e 68 74 6d 6c 0a 0a 37 |k-tables|.html..7|
|00006100| 68 74 74 70 3a 2f 2f 64 | 65 76 2e 6d 79 73 71 6c |http://d|ev.mysql|
|00006110| 2e 63 6f 6d 2f 64 6f 63 | 2f 72 65 66 6d 61 6e 2f |.com/doc|/refman/|
|00006120| 35 2e 30 2f 65 6e 2f 6c | 6f 63 6b 2d 74 61 62 6c |5.0/en/l|ock-tabl|
|00006130| 65 73 2e 68 74 6d 6c 00 | 01 04 31 32 1e 00 00 00 |es.html.|..12....|
|00006140| 0b 52 45 53 45 54 20 53 | 4c 41 56 45 18 00 e4 03 |.RESET S|LAVE....|
|00006150| 53 79 6e 74 61 78 3a 0a | 52 45 53 45 54 20 53 4c |Syntax:.|RESET SL|
|00006160| 41 56 45 0a 0a 52 45 53 | 45 54 20 53 4c 41 56 45 |AVE..RES|ET SLAVE|
|00006170| 20 6d 61 6b 65 73 20 74 | 68 65 20 73 6c 61 76 65 | makes t|he slave|
|00006180| 20 66 6f 72 67 65 74 20 | 69 74 73 20 72 65 70 6c | forget |its repl|
|00006190| 69 63 61 74 69 6f 6e 20 | 70 6f 73 69 74 69 6f 6e |ication |position|
|000061a0| 20 69 6e 20 74 68 65 0a | 6d 61 73 74 65 72 27 73 | in the.|master's|
|000061b0| 20 62 69 6e 61 72 79 20 | 6c 6f 67 73 2e 20 54 68 | binary |logs. Th|
|000061c0| 69 73 20 73 74 61 74 65 | 6d 65 6e 74 20 69 73 20 |is state|ment is |
|000061d0| 6d 65 61 6e 74 20 74 6f | 20 62 65 20 75 73 65 64 |meant to| be used|
|000061e0| 20 66 6f 72 20 61 20 63 | 6c 65 61 6e 0a 73 74 61 | for a c|lean.sta|
|000061f0| 72 74 3a 20 49 74 20 64 | 65 6c 65 74 65 73 20 74 |rt: It d|eletes t|
|00006200| 68 65 20 6d 61 73 74 65 | 72 2e 69 6e 66 6f 20 61 |he maste|r.info a|
|00006210| 6e 64 20 72 65 6c 61 79 | 2d 6c 6f 67 2e 69 6e 66 |nd relay|-log.inf|
|00006220| 6f 20 66 69 6c 65 73 2c | 20 61 6c 6c 20 74 68 65 |o files,| all the|
|00006230| 0a 72 65 6c 61 79 20 6c | 6f 67 73 2c 20 61 6e 64 |.relay l|ogs, and|
|00006240| 20 73 74 61 72 74 73 20 | 61 20 6e 65 77 20 72 65 | starts |a new re|
|00006250| 6c 61 79 20 6c 6f 67 2e | 0a 0a 4e 6f 74 65 3a 20 |lay log.|..Note: |
|00006260| 41 6c 6c 20 72 65 6c 61 | 79 20 6c 6f 67 73 20 61 |All rela|y logs a|
|00006270| 72 65 20 64 65 6c 65 74 | 65 64 2c 20 65 76 65 6e |re delet|ed, even|
|00006280| 20 69 66 20 74 68 65 79 | 20 68 61 76 65 20 6e 6f | if they| have no|
|00006290| 74 20 62 65 65 6e 20 63 | 6f 6d 70 6c 65 74 65 6c |t been c|ompletel|
|000062a0| 79 0a 65 78 65 63 75 74 | 65 64 20 62 79 20 74 68 |y.execut|ed by th|
|000062b0| 65 20 73 6c 61 76 65 20 | 53 51 4c 20 74 68 72 65 |e slave |SQL thre|
|000062c0| 61 64 2e 20 28 54 68 69 | 73 20 69 73 20 61 20 63 |ad. (Thi|s is a c|
|000062d0| 6f 6e 64 69 74 69 6f 6e | 20 6c 69 6b 65 6c 79 20 |ondition| likely |
|000062e0| 74 6f 20 65 78 69 73 74 | 0a 6f 6e 20 61 20 72 65 |to exist|.on a re|
|000062f0| 70 6c 69 63 61 74 69 6f | 6e 20 73 6c 61 76 65 20 |plicatio|n slave |
|00006300| 69 66 20 79 6f 75 20 68 | 61 76 65 20 69 73 73 75 |if you h|ave issu|
|00006310| 65 64 20 61 20 53 54 4f | 50 20 53 4c 41 56 45 20 |ed a STO|P SLAVE |
|00006320| 73 74 61 74 65 6d 65 6e | 74 20 6f 72 20 69 66 0a |statemen|t or if.|
|00006330| 74 68 65 20 73 6c 61 76 | 65 20 69 73 20 68 69 67 |the slav|e is hig|
|00006340| 68 6c 79 20 6c 6f 61 64 | 65 64 2e 29 0a 0a 43 6f |hly load|ed.)..Co|
|00006350| 6e 6e 65 63 74 69 6f 6e | 20 69 6e 66 6f 72 6d 61 |nnection| informa|
|00006360| 74 69 6f 6e 20 73 74 6f | 72 65 64 20 69 6e 20 74 |tion sto|red in t|
|00006370| 68 65 20 6d 61 73 74 65 | 72 2e 69 6e 66 6f 20 66 |he maste|r.info f|
|00006380| 69 6c 65 20 69 73 20 69 | 6d 6d 65 64 69 61 74 65 |ile is i|mmediate|
|00006390| 6c 79 0a 72 65 73 65 74 | 20 75 73 69 6e 67 20 61 |ly.reset| using a|
|000063a0| 6e 79 20 76 61 6c 75 65 | 73 20 73 70 65 63 69 66 |ny value|s specif|
|000063b0| 69 65 64 20 69 6e 20 74 | 68 65 20 63 6f 72 72 65 |ied in t|he corre|
|000063c0| 73 70 6f 6e 64 69 6e 67 | 20 73 74 61 72 74 75 70 |sponding| startup|
|000063d0| 20 6f 70 74 69 6f 6e 73 | 2e 0a 54 68 69 73 20 69 | options|..This i|
|000063e0| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 69 6e 63 6c 75 |nformati|on inclu|
|000063f0| 64 65 73 20 76 61 6c 75 | 65 73 20 73 75 63 68 20 |des valu|es such |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.