1 linerad = 10px 2 linewid *= 0.5 3 $h = 0.21 4margin = 1cm 5debug_label_color = Red 6color = lightgray 7 8 circle radius 10% 9OUT: 6.3in right of previous.e # FIX ME 10IN_X: linerad east of first circle.e 11 12 # The literal-value line 13 arrow 14LTV: box "literal-value" fit 15 arrow right even with linerad+2*arrowht east of OUT 16 circle same 17 18 # The bind-parameter line 19 right 20BNDP: oval "bind-parameter" fit with .w at 1.25*$h below LTV.w 21 arrow right even with OUT; line right linerad then up linerad 22 arrow from first circle.e right linerad then down even with BNDP \ 23 then to BNDP.w 24 25 # The table column reference line 26 right 27SN: oval "schema-name" fit with .w at 2.0*$h below BNDP.w 28 arrow 2*arrowht 29 oval "." bold fit 30 arrow 31TN: oval "table-name" fit 32 arrow right 2*arrowht 33 oval "." bold fit 34 arrow 35CN: oval "column-name" fit 36 arrow right even with OUT; line right linerad then up linerad 37 arrow from (IN_X,SN.n) down even with SN then to SN.w 38TN_Y: 0.375*$h above TN.n 39 arrow from (IN_X,linerad above TN_Y) down linerad \ 40 then right even with SN 41 arrow right right even with TN 42 line right even with linerad+arrowht west of CN.w \ 43 then down even with CN then right linerad 44 line from (linerad+2*arrowht left of TN.w,TN_Y) right linerad \ 45 then down even with TN then right linerad 46 47 # Unary operators 48 right 49UOP: oval "unary-operator" fit with .w at 1.25*$h below SN.w 50 arrow right even with OUT; line right linerad then up linerad 51 arrow from (IN_X,UOP.n) down even with UOP then to UOP.w 52 53 # Binary operators 54 right 55BINY: box "expr" fit with .w at 1.25*$h below UOP.w 56 arrow 2*arrowht 57 oval "binary-operator" fit 58 arrow 2*arrowht 59 box "expr" fit 60 arrow right even with OUT; line right linerad then up linerad 61 arrow from (IN_X,BINY.n) down even with BINY then to BINY.w 62 63 # Function calls 64 right 65FUNC: oval "function-name" fit with .w at 2.0*$h below BINY.w 66 arrow 1.5*arrowht 67FLP: oval "(" bold fit 68 arrow 69FDCT: oval "DISTINCT" fit 70 arrow 71FEXP: box "expr" fit 72 arrow 150% 73FRP: oval ")" bold fit 74 arrow right linerad then down $h then right 2*arrowht 75FFC: box "filter-clause" fit 76FA1: arrow right linerad then up even with FUNC then right 2*arrowht 77 arrow right linerad then down $h then right 2*arrowht 78FOC: box "over-clause" fit 79 arrow right even with OUT; line right linerad then up linerad 80 arrow from (IN_X,FUNC.n) down even with FUNC then to FUNC.w 81 82 # filter clause bypass 83 arrow from FRP.e right even with FFC 84 line to arrowht left of FA1.end 85 86 # over clause bypass 87 arrow from FA1.end right even with OUT 88 line right linerad then up linerad 89 90 # expr loop 91 FCMA: oval "," bold fit at 1.25*$h above FEXP 92 arrow from FEXP.e right linerad then up even with FCMA \ 93 then to FCMA.e 94 line from FCMA.w left even with 2*arrowht west of FEXP.w \ 95 then down even with FEXP then right linerad 96 97 # "*" argument list 98 FSTR: oval "*" bold fit with .w at 1.25*$h below FDCT.w 99 arrow from FLP.e right linerad then down even with FSTR \ 100 then to FSTR.w 101 FA2: arrow from FSTR.e right even with linerad+2*arrowht west of FRP.w 102 line right linerad then up even with FRP then right linerad 103 104 # empty argument list 105 arrow from (linerad east of FLP.e,FSTR.n) \ 106 down even with $h below FSTR then right even with FDCT.w 107 arrow right even with FA2.end 108 line right linerad then up even with FSTR.n 109 110 # parenthesized and vector expressions 111 right 112PRN: oval "(" bold fit with .w at 3.0*$h below FUNC.w 113 arrow 114PEXP: box "expr" fit 115 arrow 116 oval ")" bold fit 117 arrow right even with OUT; line right linerad then up linerad 118 arrow from (IN_X,PRN.n) down even with PRN then to PRN.w 119 120 # expr loop 121 PCMA: oval "," bold fit at 1.25*$h above PEXP 122 arrow from PEXP.e right linerad then up even with PCMA \ 123 then to PCMA.e 124 line from PCMA.w left even with 2*arrowht left of PEXP.w \ 125 then down even with PEXP then right linerad 126 127 # CAST expression 128 right 129CAST: oval "CAST" fit with .w at 1.25*$h below PRN.w 130 arrow 2*arrowht 131 oval "(" bold fit 132 arrow 2*arrowht 133 box "expr" fit 134 arrow 2*arrowht 135 oval "AS" fit 136 arrow 2*arrowht 137 box "type-name" fit 138 arrow 2*arrowht 139 oval ")" bold fit 140 arrow right even with OUT; line right linerad then up linerad 141 arrow from (IN_X,CAST.n) down even with CAST then to CAST.w 142 143 # COLLATE expression 144 right 145COLL: box "expr" fit with .w at 1.25*$h below CAST.w 146 arrow 2*arrowht 147 oval "COLLATE" fit 148 arrow 2*arrowht 149 oval "collation-name" fit 150 arrow right even with OUT; line right linerad then up linerad 151 arrow from (IN_X,COLL.n) down even with COLL then to COLL.w 152 153 # LIKE expressions 154 right 155LIKE: box "expr" fit with .w at 1.25*$h below COLL.w 156 arrow 157LNOT: oval "NOT" fit 158 arrow 150% 159LOP1: oval "LIKE" fit 160LOP2: oval "GLOB" fit with .w at 1.25*$h below LOP1.w 161LOP3: oval "REGEXP" fit with .w at 1.25*$h below LOP2.w 162LOP4: oval "MATCH" fit with .w at 1.25*$h below LOP3.w 163LE2: box "expr" fit with .w at (4*arrowht+linerad east of LOP3.e,LIKE) 164 arrow from LE2.e right linerad then down $h then right 2*arrowht 165LESC: oval "ESCAPE" fit 166 arrow 2*arrowht 167 box "expr" fit 168LA1: arrow right linerad then up even with LIKE then right 169 arrow right even with OUT; line right linerad then up linerad 170 arrow from (IN_X,LIKE.n) down even with LIKE then to LIKE.w 171 172 # NOT bypass 173 line from linerad*2 west of LNOT.w \ 174 right linerad then down $h \ 175 then right even with arrowht east of LNOT.e \ 176 then up even with LNOT then right linerad 177 178 # Inputs to the operators 179 LX1: 2*arrowht west of LOP1.w 180 arrow from linerad west of LX1 right linerad \ 181 then down even with LOP4 then to LOP4.w 182 arrow from (LX1,LOP2.n) down even with LOP2 then to LOP2.w 183 arrow from (LX1,LOP3.n) down even with LOP3 then to LOP3.w 184 185 # Outputs from the operators 186 LX2: 2*arrowht east of LOP3.e 187 arrow from LOP4.e right even with LX2 188 arrow right linerad then up even with LE2 then to LE2.w 189 arrow from LOP3.e right even with LX2 190 line right linerad then up linerad 191 arrow from LOP2.e right even with LX2 192 line right linerad then up linerad 193 line from LOP1.e to arrowht west of LE2.w 194 195 # ESCAPE bypass 196 arrow from LE2.e right even with LESC 197 line to arrowht left of LA1.end 198 199 # ISNULL and NOTNULL operators 200 right 201NNUL: box "expr" fit with .w at 5.0*$h below LIKE.w 202 arrow 203NN1: oval "ISNULL" fit 204 arrow right even with OUT; line right linerad then up linerad 205 arrow from (IN_X,NNUL.n) down even with NNUL then to NNUL.w 206NN2: oval "NOTNULL" fit with .w at 1.25*$h below NN1.w 207 right 208NN3: oval "NOT" fit with .w at 1.25*$h below NN2.w 209 arrow 2*arrowht 210NN3B: oval "NULL" fit 211NNA1: arrow 2*arrowht 212 arrow right linerad then up even with NN1 then right 213 arrow from NN2.e right even with NNA1.end 214 line right linerad then up linerad 215 arrow from NNUL.e right linerad then down even with NN3 then to NN3.w 216 arrow from NNUL.e right linerad then down even with NN2 then to NN2.w 217 218 # The IS operator 219 right 220IS: box "expr" fit with .w at 3.75*$h below NNUL.w 221 arrow 2*arrowht 222 oval "IS" fit 223 arrow 224ISN: oval "NOT" fit 225 arrow 226 box "expr" fit 227 arrow right even with OUT; line right linerad then up linerad 228 arrow from (IN_X,IS.n) down even with IS then to IS.w 229 # NOT bypass 230 line from 3*arrowht west of ISN.w right linerad \ 231 then down 0.8*$h then right even with arrowht east of ISN.e \ 232 then up even with ISN then right linerad 233 234# Error message deep inside a long script. 235# This error is on line 236 236error "hello" 237 238 # The BETWEEN operator 239 right 240BTW: box "expr" fit with .w at 1.5*$h below IS.w 241 arrow 242BTWN: oval "NOT" fit 243 arrow 244 oval "BETWEEN" fit 245 arrow 2*arrowht 246 box "expr" fit 247 arrow 2*arrowht 248 oval "AND" fit 249 arrow 2*arrowht 250 box "expr" fit 251 arrow right even with OUT; line right linerad then up linerad 252 arrow from (IN_X,BTW.n) down even with BTW then to BTW.w 253 # NOT bypass 254 line from 3*arrowht west of BTWN.w right linerad \ 255 then down 0.8*$h then right even with arrowht east of BTWN.e \ 256 then up even with BTWN then right linerad 257 258 # The IN operator 259 right 260IN: box "expr" fit with .w at 1.75*$h below BTW.w 261 arrow 262INNT: oval "NOT" fit 263 arrow 264ININ: oval "IN" fit 265 arrow 266INLP: oval "(" bold fit 267 arrow 268INSS: box "select-stmt" fit 269 arrow 270 oval ")" bold fit 271 arrow right even with OUT; line right linerad then up linerad 272 arrow from (IN_X,IN.n) down even with IN then to IN.w 273 274 # NOT bypass 275 line from 3*arrowht west of INNT.w right linerad \ 276 then down 0.8*$h then right even with arrowht east of INNT.e \ 277 then up even with INNT then right linerad 278 279 # select-stmt bypass 280 line from 3*arrowht west of INSS.w right linerad \ 281 then up 0.8*$h then right even with arrowht east of INSS.e \ 282 then up even with INSS then right linerad 283 284 # expr list instead of select-stmt 285 INE1: box "expr" fit at 1.25*$h below INSS 286 arrow from 3*arrowht west of INSS.w right linerad \ 287 then down even with INE1 then to INE1.w 288 line from INE1.e right even with arrowht east of INSS.e \ 289 then up even with INSS then right linerad 290 291 # expr loop 292 INC1: oval "," bold fit at 1.25*$h below INE1 293 arrow from INE1.e right linerad then down even with INC1 \ 294 then to INC1.e 295 line from INC1.w left even with 2*arrowht west of INE1.w \ 296 then up even with INE1 then right linerad 297 298 # reference-to-table choice as RHS 299 INSN: oval "schema-name" fit with .w at 4.25*$h below INLP.w 300 arrow from INSN.e right 1.5*arrowht 301 INDT: oval "." bold fit 302 arrow 150% 303 INTF: oval "table-function" fit 304 arrow 1.5*arrowht 305 INL2: oval "(" bold fit 306 arrow 125% 307 INE2: box "expr" fit 308 arrow 125% 309 INR2: oval ")" bold fit 310 arrow right even with OUT; line right linerad then up linerad 311 312 # table reference branch 313 right 314 INTB: oval "table-name" fit with .w at 2*$h above INTF.w 315 arrow right even with OUT; line right linerad then up linerad 316 arrow from linerad+2*arrowht west of INTF.w right linerad \ 317 then up even with INTB then to INTB.w 318 319 # expr-list no table-valued-functions 320 INC2: oval "," bold fit at 1.1*$h above INE2 321 arrow from INE2.e right linerad then up even with INC2 \ 322 then to INC2.e 323 line from INC2.w right even with 2*arrowht west of INE2.w \ 324 then down even with INE2 then right linerad 325 326 # expr-list bypass for table-valued functions 327 line from INL2.e right linerad then down .7*$h \ 328 then right even with 2*arrowht left of INR2.w \ 329 then up even with INR2 then right linerad 330 331 # links from IN operator to table references 332 arrow from ININ.e right linerad then down even with INSN \ 333 then to INSN.w 334 335 # schema-name bypass 336 INY3: 0.45*$h above INSN.n 337 arrow from (linerad east of ININ.e,linerad above INY3) \ 338 down linerad then right even with arrowht right of INSN.e 339 line right even with arrowht east of INDT.e \ 340 then down even with INDT then right linerad 341 342 # NOT? EXISTS? (SELECT) clause 343 right 344NE: oval "NOT" fit with .w at (IN.w,1.5*$h below INSN) 345 arrow 346NEE: oval "EXISTS" fit 347 arrow 348NELP: oval "(" bold fit 349 arrow 2*arrowht 350 box "select-stmt" fit 351 arrow 2*arrowht 352 oval ")" bold fit 353 arrow right even with OUT; line right linerad then up linerad 354 arrow from (IN_X,NE.n) down even with NE then to NE.w 355NE_Y: 0.375*$h above NE.n 356 arrow from (IN_X,linerad above NE_Y) down linerad \ 357 then right even with NE 358 line right even with linerad+arrowht west of NELP.w \ 359 then down even with NELP then right linerad 360 line from (linerad+2*arrowht left of NEE.w,NE_Y) right linerad \ 361 then down even with NEE then right linerad 362 363 # CASE expressions 364 right 365CS: oval "CASE" fit with .w at 1.25*$h below NE.w 366 arrow 367CSE1: box "expr" fit 368 arrow 150% 369CSW: oval "WHEN" fit 370 arrow 2*arrowht 371CSE2: box "expr" fit 372 arrow 2*arrowht 373 oval "THEN" fit 374 arrow 2*arrowht 375CSE3: box "expr" fit 376 arrow 200% 377CSEL: oval "ELSE" fit 378 arrow 2*arrowht 379CSE4: box "expr" fit 380 arrow 381 oval "END" fit 382 arrow right even with OUT; line right linerad then up linerad 383 arrow from (IN_X,CS.n) down even with CS then to CS.w 384 # first expr bypass 385CSY: 0.9*$h below CS 386 line from CS.e right linerad then down even with CSY \ 387 then right even with arrowht east of CSE1.e then up even with CSE1 \ 388 then right linerad 389 # when clause loop 390 arrow from CSE3.e right linerad then down even with CSY \ 391 then left even with CSE2 392 line left even with 2*arrowht west of CSW.w \ 393 then up even with CSW then right linerad 394 # ELSE clause bypass 395 line from linerad+2*arrowht west of CSEL.w right linerad \ 396 then down even with CSY then right even with arrowht east of CSE4.e \ 397 then up even with CSE4 then right linerad 398 399 # The RAISE function 400 right 401RSE: box "raise-function" fit with .w at 1.9*$h below CS.w 402 arrow right even with OUT; 403 line right linerad then up even with first circle then right linerad 404 arrow from (IN_X,BNDP.n) down even with RSE then to RSE.w 405