expressions.err 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. Registering pre-existing tables
  2. date_tbl
  3. <sql-statement>
  4. --
  5. -- expression evaluation tests that don't fit into a more specific file
  6. --
  7. --
  8. -- Tests for SQLVAlueFunction
  9. --
  10. -- current_date (always matches because of transactional behaviour)
  11. SELECT date(now())::text = current_date::text;
  12. </sql-statement>
  13. <sql-statement>
  14. -- current_time / localtime
  15. SELECT now()::timetz::text = current_time::text;
  16. </sql-statement>
  17. <sql-statement>
  18. SELECT now()::timetz(4)::text = current_time(4)::text;
  19. </sql-statement>
  20. <sql-statement>
  21. SELECT now()::time::text = localtime::text;
  22. </sql-statement>
  23. -stdin-:<main>: Error: Parse Sql
  24. -stdin-:<main>:1:28: Error: Usupported SQLValueFunction: 5
  25. SELECT now()::time::text = localtime::text;
  26. ^
  27. <sql-statement>
  28. SELECT now()::time(3)::text = localtime(3)::text;
  29. </sql-statement>
  30. -stdin-:<main>: Error: Parse Sql
  31. -stdin-:<main>:1:31: Error: Usupported SQLValueFunction: 6
  32. SELECT now()::time(3)::text = localtime(3)::text;
  33. ^
  34. <sql-statement>
  35. -- current_timestamp / localtimestamp (always matches because of transactional behaviour)
  36. SELECT current_timestamp = NOW();
  37. </sql-statement>
  38. <sql-statement>
  39. -- precision
  40. SELECT length(current_timestamp::text) >= length(current_timestamp(0)::text);
  41. </sql-statement>
  42. <sql-statement>
  43. -- localtimestamp
  44. SELECT now()::timestamp::text = localtimestamp::text;
  45. </sql-statement>
  46. -stdin-:<main>: Error: Parse Sql
  47. -stdin-:<main>:2:33: Error: Usupported SQLValueFunction: 7
  48. SELECT now()::timestamp::text = localtimestamp::text;
  49. ^
  50. <sql-statement>
  51. -- current_role/user/user is tested in rolnames.sql
  52. -- current database / catalog
  53. SELECT current_catalog = current_database();
  54. </sql-statement>
  55. <sql-statement>
  56. -- current_schema
  57. SELECT current_schema;
  58. </sql-statement>
  59. <sql-statement>
  60. SET search_path = 'notme';
  61. </sql-statement>
  62. -stdin-:<main>: Error: Parse Sql
  63. -stdin-:<main>:1:1: Error: VariableSetStmt, search path supports only 'information_schema', 'public', 'pg_catalog', '' but got: 'notme'
  64. SET search_path = 'notme';
  65. ^
  66. <sql-statement>
  67. SELECT current_schema;
  68. </sql-statement>
  69. <sql-statement>
  70. SET search_path = 'pg_catalog';
  71. </sql-statement>
  72. <sql-statement>
  73. SELECT current_schema;
  74. </sql-statement>
  75. <sql-statement>
  76. RESET search_path;
  77. </sql-statement>
  78. -stdin-:<main>: Error: Parse Sql
  79. -stdin-:<main>:1:1: Error: VariableSetStmt, not supported kind: 4
  80. RESET search_path;
  81. ^
  82. <sql-statement>
  83. --
  84. -- Tests for BETWEEN
  85. --
  86. explain (costs off)
  87. select count(*) from date_tbl
  88. where f1 between '1997-01-01' and '1998-01-01';
  89. </sql-statement>
  90. -stdin-:<main>: Error: Parse Sql
  91. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  92. --
  93. ^
  94. <sql-statement>
  95. select count(*) from date_tbl
  96. where f1 between '1997-01-01' and '1998-01-01';
  97. </sql-statement>
  98. -stdin-:<main>: Error: Type annotation
  99. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
  100. select count(*) from date_tbl
  101. ^
  102. -stdin-:<main>:1:22: Error: At function: PgReadTable!
  103. select count(*) from date_tbl
  104. ^
  105. -stdin-:<main>:1:22: Error: Unsupported table: date_tbl
  106. select count(*) from date_tbl
  107. ^
  108. <sql-statement>
  109. explain (costs off)
  110. select count(*) from date_tbl
  111. where f1 not between '1997-01-01' and '1998-01-01';
  112. </sql-statement>
  113. -stdin-:<main>: Error: Parse Sql
  114. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  115. explain (costs off)
  116. ^
  117. <sql-statement>
  118. select count(*) from date_tbl
  119. where f1 not between '1997-01-01' and '1998-01-01';
  120. </sql-statement>
  121. -stdin-:<main>: Error: Type annotation
  122. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
  123. select count(*) from date_tbl
  124. ^
  125. -stdin-:<main>:1:22: Error: At function: PgReadTable!
  126. select count(*) from date_tbl
  127. ^
  128. -stdin-:<main>:1:22: Error: Unsupported table: date_tbl
  129. select count(*) from date_tbl
  130. ^
  131. <sql-statement>
  132. explain (costs off)
  133. select count(*) from date_tbl
  134. where f1 between symmetric '1997-01-01' and '1998-01-01';
  135. </sql-statement>
  136. -stdin-:<main>: Error: Parse Sql
  137. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  138. explain (costs off)
  139. ^
  140. <sql-statement>
  141. select count(*) from date_tbl
  142. where f1 between symmetric '1997-01-01' and '1998-01-01';
  143. </sql-statement>
  144. -stdin-:<main>: Error: Type annotation
  145. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
  146. select count(*) from date_tbl
  147. ^
  148. -stdin-:<main>:1:22: Error: At function: PgReadTable!
  149. select count(*) from date_tbl
  150. ^
  151. -stdin-:<main>:1:22: Error: Unsupported table: date_tbl
  152. select count(*) from date_tbl
  153. ^
  154. <sql-statement>
  155. explain (costs off)
  156. select count(*) from date_tbl
  157. where f1 not between symmetric '1997-01-01' and '1998-01-01';
  158. </sql-statement>
  159. -stdin-:<main>: Error: Parse Sql
  160. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  161. explain (costs off)
  162. ^
  163. <sql-statement>
  164. select count(*) from date_tbl
  165. where f1 not between symmetric '1997-01-01' and '1998-01-01';
  166. </sql-statement>
  167. -stdin-:<main>: Error: Type annotation
  168. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem
  169. select count(*) from date_tbl
  170. ^
  171. -stdin-:<main>:1:22: Error: At function: PgReadTable!
  172. select count(*) from date_tbl
  173. ^
  174. -stdin-:<main>:1:22: Error: Unsupported table: date_tbl
  175. select count(*) from date_tbl
  176. ^
  177. <sql-statement>
  178. --
  179. -- Test parsing of a no-op cast to a type with unspecified typmod
  180. --
  181. begin;
  182. </sql-statement>
  183. <sql-statement>
  184. create table numeric_tbl (f1 numeric(18,3), f2 numeric);
  185. </sql-statement>
  186. <sql-statement>
  187. create view numeric_view as
  188. select
  189. f1, f1::numeric(16,4) as f1164, f1::numeric as f1n,
  190. f2, f2::numeric(16,4) as f2164, f2::numeric as f2n
  191. from numeric_tbl;
  192. </sql-statement>
  193. -stdin-:<main>: Error: Parse Sql
  194. -stdin-:<main>:1:1: Error: expected at least one target column
  195. create view numeric_view as
  196. ^
  197. <sql-statement>
  198. \d+ numeric_view
  199. </sql-statement>
  200. Metacommand \d+ numeric_view is not supported
  201. <sql-statement>
  202. explain (verbose, costs off) select * from numeric_view;
  203. </sql-statement>
  204. -stdin-:<main>: Error: Parse Sql
  205. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  206. explain (verbose, costs off) select * from numeric_view;
  207. ^
  208. <sql-statement>
  209. -- bpchar, lacking planner support for its length coercion function,
  210. -- could behave differently
  211. create table bpchar_tbl (f1 character(16) unique, f2 bpchar);
  212. </sql-statement>
  213. <sql-statement>
  214. create view bpchar_view as
  215. select
  216. f1, f1::character(14) as f114, f1::bpchar as f1n,
  217. f2, f2::character(14) as f214, f2::bpchar as f2n
  218. from bpchar_tbl;
  219. </sql-statement>
  220. -stdin-:<main>: Error: Parse Sql
  221. -stdin-:<main>:1:1: Error: expected at least one target column
  222. create view bpchar_view as
  223. ^
  224. <sql-statement>
  225. \d+ bpchar_view
  226. </sql-statement>
  227. Metacommand \d+ bpchar_view is not supported
  228. <sql-statement>
  229. explain (verbose, costs off) select * from bpchar_view
  230. where f1::bpchar = 'foo';
  231. </sql-statement>
  232. -stdin-:<main>: Error: Parse Sql
  233. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  234. explain (verbose, costs off) select * from bpchar_view
  235. ^
  236. <sql-statement>
  237. rollback;
  238. </sql-statement>
  239. <sql-statement>
  240. --
  241. -- Ordinarily, IN/NOT IN can be converted to a ScalarArrayOpExpr
  242. -- with a suitably-chosen array type.
  243. --
  244. explain (verbose, costs off)
  245. select random() IN (1, 4, 8.0);
  246. </sql-statement>
  247. -stdin-:<main>: Error: Parse Sql
  248. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  249. --
  250. ^
  251. <sql-statement>
  252. explain (verbose, costs off)
  253. select random()::int IN (1, 4, 8.0);
  254. </sql-statement>
  255. -stdin-:<main>: Error: Parse Sql
  256. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 276
  257. explain (verbose, costs off)
  258. ^
  259. <sql-statement>
  260. -- However, if there's not a common supertype for the IN elements,
  261. -- we should instead try to produce "x = v1 OR x = v2 OR ...".
  262. -- In most cases that'll fail for lack of all the requisite = operators,
  263. -- but it can succeed sometimes. So this should complain about lack of
  264. -- an = operator, not about cast failure.
  265. select '(0,0)'::point in ('(0,0,0,0)'::box, point(0,0));
  266. </sql-statement>
  267. -stdin-:<main>: Error: Type annotation
  268. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
  269. -- However, if there's not a common supertype for the IN elements,
  270. ^
  271. -stdin-:<main>:6:23: Error: At function: PgIn
  272. select '(0,0)'::point in ('(0,0,0,0)'::box, point(0,0));
  273. ^
  274. -stdin-:<main>:6:40: Error: Cannot infer common type for types 600 and 603
  275. select '(0,0)'::point in ('(0,0,0,0)'::box, point(0,0));
  276. ^
  277. <sql-statement>
  278. --
  279. -- Tests for ScalarArrayOpExpr with a hashfn
  280. --
  281. -- create a stable function so that the tests below are not
  282. -- evaluated using the planner's constant folding.
  283. begin;
  284. </sql-statement>
  285. <sql-statement>
  286. create function return_int_input(int) returns int as $$
  287. begin
  288. return $1;
  289. end;
  290. $$ language plpgsql stable;
  291. </sql-statement>
  292. -stdin-:<main>: Error: Parse Sql
  293. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  294. create function return_int_input(int) returns int as $$
  295. ^
  296. <sql-statement>
  297. create function return_text_input(text) returns text as $$
  298. begin
  299. return $1;
  300. end;
  301. $$ language plpgsql stable;
  302. </sql-statement>
  303. -stdin-:<main>: Error: Parse Sql
  304. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  305. create function return_text_input(text) returns text as $$
  306. ^
  307. <sql-statement>
  308. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
  309. </sql-statement>
  310. -stdin-:<main>: Error: Type annotation
  311. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
  312. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
  313. ^
  314. -stdin-:<main>:1:28: Error: At function: PgIn
  315. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
  316. ^
  317. -stdin-:<main>:1:8: Error: At function: PgCall
  318. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
  319. ^
  320. -stdin-:<main>:1:8: Error: No such proc: return_int_input
  321. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
  322. ^
  323. <sql-statement>
  324. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
  325. </sql-statement>
  326. -stdin-:<main>: Error: Type annotation
  327. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
  328. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
  329. ^
  330. -stdin-:<main>:1:28: Error: At function: PgIn
  331. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
  332. ^
  333. -stdin-:<main>:1:8: Error: At function: PgCall
  334. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
  335. ^
  336. -stdin-:<main>:1:8: Error: No such proc: return_int_input
  337. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
  338. ^
  339. <sql-statement>
  340. select return_int_input(1) in (null, null, null, null, null, null, null, null, null, null, null);
  341. </sql-statement>
  342. -stdin-:<main>: Error: Type annotation
  343. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
  344. select return_int_input(1) in (null, null, null, null, null, null, null, null, null, null, null);
  345. ^
  346. -stdin-:<main>:1:28: Error: At function: PgIn
  347. select return_int_input(1) in (null, null, null, null, null, null, null, null, null, null, null);
  348. ^
  349. -stdin-:<main>:1:8: Error: At function: PgCall
  350. select return_int_input(1) in (null, null, null, null, null, null, null, null, null, null, null);
  351. ^
  352. -stdin-:<main>:1:8: Error: No such proc: return_int_input
  353. select return_int_input(1) in (null, null, null, null, null, null, null, null, null, null, null);
  354. ^
  355. <sql-statement>
  356. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1, null);
  357. </sql-statement>
  358. -stdin-:<main>: Error: Type annotation
  359. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
  360. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1, null);
  361. ^
  362. -stdin-:<main>:1:28: Error: At function: PgIn
  363. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1, null);
  364. ^
  365. -stdin-:<main>:1:8: Error: At function: PgCall
  366. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1, null);
  367. ^
  368. -stdin-:<main>:1:8: Error: No such proc: return_int_input
  369. select return_int_input(1) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1, null);
  370. ^
  371. <sql-statement>
  372. select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
  373. </sql-statement>
  374. -stdin-:<main>: Error: Type annotation
  375. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
  376. select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
  377. ^
  378. -stdin-:<main>:1:36: Error: At function: PgIn
  379. select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
  380. ^
  381. -stdin-:<main>:1:8: Error: At function: PgCall
  382. select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
  383. ^
  384. -stdin-:<main>:1:8: Error: No such proc: return_int_input
  385. select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, 1);
  386. ^
  387. <sql-statement>
  388. select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
  389. </sql-statement>
  390. -stdin-:<main>: Error: Type annotation
  391. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
  392. select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
  393. ^
  394. -stdin-:<main>:1:36: Error: At function: PgIn
  395. select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
  396. ^
  397. -stdin-:<main>:1:8: Error: At function: PgCall
  398. select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
  399. ^
  400. -stdin-:<main>:1:8: Error: No such proc: return_int_input
  401. select return_int_input(null::int) in (10, 9, 2, 8, 3, 7, 4, 6, 5, null);
  402. ^
  403. <sql-statement>
  404. select return_text_input('a') in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
  405. </sql-statement>
  406. -stdin-:<main>: Error: Type annotation
  407. -stdin-:<main>:1:1: Error: At function: RemovePrefixMembers, At function: PgSelect, At function: PgSetItem, At function: PgResultItem
  408. select return_text_input('a') in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
  409. ^
  410. -stdin-:<main>:1:31: Error: At function: PgIn
  411. select return_text_input('a') in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
  412. ^
  413. -stdin-:<main>:1:8: Error: At function: PgCall
  414. select return_text_input('a') in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
  415. ^
  416. -stdin-:<main>:1:8: Error: No such proc: return_text_input
  417. select return_text_input('a') in ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j');
  418. ^
  419. <sql-statement>
  420. rollback;
  421. </sql-statement>
  422. <sql-statement>
  423. -- Test with non-strict equality function.
  424. -- We need to create our own type for this.
  425. begin;
  426. </sql-statement>
  427. <sql-statement>
  428. create type myint;
  429. </sql-statement>
  430. -stdin-:<main>: Error: Parse Sql
  431. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
  432. create type myint;
  433. ^
  434. <sql-statement>
  435. create function myintin(cstring) returns myint strict immutable language
  436. internal as 'int4in';
  437. </sql-statement>
  438. -stdin-:<main>: Error: Parse Sql
  439. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  440. create function myintin(cstring) returns myint strict immutable language
  441. ^
  442. <sql-statement>
  443. create function myintout(myint) returns cstring strict immutable language
  444. internal as 'int4out';
  445. </sql-statement>
  446. -stdin-:<main>: Error: Parse Sql
  447. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  448. create function myintout(myint) returns cstring strict immutable language
  449. ^
  450. <sql-statement>
  451. create function myinthash(myint) returns integer strict immutable language
  452. internal as 'hashint4';
  453. </sql-statement>
  454. -stdin-:<main>: Error: Parse Sql
  455. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  456. create function myinthash(myint) returns integer strict immutable language
  457. ^
  458. <sql-statement>
  459. create type myint (input = myintin, output = myintout, like = int4);
  460. </sql-statement>
  461. -stdin-:<main>: Error: Parse Sql
  462. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
  463. create type myint (input = myintin, output = myintout, like = int4);
  464. ^
  465. <sql-statement>
  466. create cast (int4 as myint) without function;
  467. </sql-statement>
  468. -stdin-:<main>: Error: Parse Sql
  469. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 297
  470. create cast (int4 as myint) without function;
  471. ^
  472. <sql-statement>
  473. create cast (myint as int4) without function;
  474. </sql-statement>
  475. -stdin-:<main>: Error: Parse Sql
  476. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 297
  477. create cast (myint as int4) without function;
  478. ^
  479. <sql-statement>
  480. create function myinteq(myint, myint) returns bool as $$
  481. begin
  482. if $1 is null and $2 is null then
  483. return true;
  484. else
  485. return $1::int = $2::int;
  486. end if;
  487. end;
  488. $$ language plpgsql immutable;
  489. </sql-statement>
  490. -stdin-:<main>: Error: Parse Sql
  491. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 261
  492. create function myinteq(myint, myint) returns bool as $$
  493. ^
  494. <sql-statement>
  495. create operator = (
  496. leftarg = myint,
  497. rightarg = myint,
  498. commutator = =,
  499. negator = <>,
  500. procedure = myinteq,
  501. restrict = eqsel,
  502. join = eqjoinsel,
  503. merges
  504. );
  505. </sql-statement>
  506. -stdin-:<main>: Error: Parse Sql
  507. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 255
  508. create operator = (
  509. ^
  510. <sql-statement>
  511. create operator class myint_ops
  512. default for type myint using hash as
  513. operator 1 = (myint, myint),
  514. function 1 myinthash(myint);
  515. </sql-statement>
  516. -stdin-:<main>: Error: Parse Sql
  517. -stdin-:<main>:1:1: Error: RawStmt: alternative is not implemented yet : 298
  518. create operator class myint_ops
  519. ^
  520. <sql-statement>
  521. create table inttest (a myint);
  522. </sql-statement>
  523. <sql-statement>
  524. insert into inttest values(1::myint),(null);
  525. </sql-statement>
  526. -stdin-:<main>: Error: Parse Sql
  527. -stdin-:<main>:1:31: Error: Unknown type: myint
  528. insert into inttest values(1::myint),(null);
  529. ^
  530. <sql-statement>
  531. -- try an array with enough elements to cause hashing
  532. select * from inttest where a in (1::myint,2::myint,3::myint,4::myint,5::myint,6::myint,7::myint,8::myint,9::myint, null);
  533. </sql-statement>
  534. -stdin-:<main>: Error: Parse Sql
  535. -stdin-:<main>:2:38: Error: Unknown type: myint
  536. select * from inttest where a in (1::myint,2::myint,3::myint,4::myint,5::myint,6::myint,7::myint,8::myint,9::myint, null);
  537. ^
  538. <sql-statement>
  539. -- ensure the result matched with the non-hashed version. We simply remove
  540. -- some array elements so that we don't reach the hashing threshold.
  541. select * from inttest where a in (1::myint,2::myint,3::myint,4::myint,5::myint, null);
  542. </sql-statement>
  543. -stdin-:<main>: Error: Parse Sql
  544. -stdin-:<main>:3:38: Error: Unknown type: myint
  545. select * from inttest where a in (1::myint,2::myint,3::myint,4::myint,5::myint, null);
  546. ^
  547. <sql-statement>
  548. rollback;
  549. </sql-statement>