pg_query 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/Rakefile +3 -4
- data/ext/pg_query/extconf.rb +14 -4
- data/ext/pg_query/include/pg_query_fingerprint_defs.c +1 -1
- data/ext/pg_query/include/pg_query_outfuncs_defs.c +1 -1
- data/ext/pg_query/include/pg_query_readfuncs_defs.c +1 -1
- data/ext/pg_query/include/{miscadmin.h → postgres/miscadmin.h} +1 -1
- data/ext/pg_query/include/{nodes → postgres/nodes}/nodes.h +1 -1
- data/ext/pg_query/include/{parser → postgres/parser}/parser.h +3 -3
- data/ext/pg_query/include/{pg_config.h → postgres/pg_config.h} +136 -2
- data/ext/pg_query/include/postgres/pg_config_os.h +8 -0
- data/ext/pg_query/include/{pgstat.h → postgres/pgstat.h} +1 -1
- data/ext/pg_query/include/{pl_gram.h → postgres/pl_gram.h} +2 -2
- data/ext/pg_query/include/{plpgsql.h → postgres/plpgsql.h} +11 -11
- data/ext/pg_query/include/postgres/port/atomics/arch-hppa.h +17 -0
- data/ext/pg_query/include/postgres/port/atomics/generic-msvc.h +101 -0
- data/ext/pg_query/include/postgres/port/atomics/generic-sunpro.h +106 -0
- data/ext/pg_query/include/postgres/port/win32/arpa/inet.h +3 -0
- data/ext/pg_query/include/postgres/port/win32/dlfcn.h +1 -0
- data/ext/pg_query/include/postgres/port/win32/grp.h +1 -0
- data/ext/pg_query/include/postgres/port/win32/netdb.h +7 -0
- data/ext/pg_query/include/postgres/port/win32/netinet/in.h +3 -0
- data/ext/pg_query/include/postgres/port/win32/netinet/tcp.h +7 -0
- data/ext/pg_query/include/postgres/port/win32/pwd.h +3 -0
- data/ext/pg_query/include/postgres/port/win32/sys/resource.h +20 -0
- data/ext/pg_query/include/postgres/port/win32/sys/select.h +3 -0
- data/ext/pg_query/include/postgres/port/win32/sys/socket.h +26 -0
- data/ext/pg_query/include/postgres/port/win32/sys/un.h +17 -0
- data/ext/pg_query/include/postgres/port/win32/sys/wait.h +3 -0
- data/ext/pg_query/include/postgres/port/win32.h +59 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/dirent.h +34 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/sys/file.h +1 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/sys/param.h +1 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/sys/time.h +1 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/unistd.h +9 -0
- data/ext/pg_query/include/postgres/port/win32_msvc/utime.h +3 -0
- data/ext/pg_query/include/postgres/port/win32_port.h +594 -0
- data/ext/pg_query/include/{postmaster → postgres/postmaster}/postmaster.h +1 -1
- data/ext/pg_query/include/{storage → postgres/storage}/ipc.h +1 -1
- data/ext/pg_query/include/{tcop → postgres/tcop}/tcopprot.h +2 -2
- data/ext/pg_query/include/{utils → postgres/utils}/builtins.h +1 -1
- data/ext/pg_query/include/{utils → postgres/utils}/elog.h +3 -3
- data/ext/pg_query/include/{utils → postgres/utils}/guc.h +4 -4
- data/ext/pg_query/include/{utils → postgres/utils}/memutils.h +2 -2
- data/ext/pg_query/include/{utils → postgres/utils}/palloc.h +1 -1
- data/ext/pg_query/pg_query.c +9 -0
- data/ext/pg_query/pg_query_fingerprint.c +4 -5
- data/ext/pg_query/pg_query_outfuncs_json.c +6 -0
- data/ext/pg_query/pg_query_outfuncs_protobuf.c +1 -0
- data/ext/pg_query/pg_query_parse.c +1 -1
- data/ext/pg_query/pg_query_parse_plpgsql.c +6 -4
- data/ext/pg_query/pg_query_readfuncs_protobuf.c +1 -0
- data/ext/pg_query/pg_query_ruby.c +5 -0
- data/ext/pg_query/pg_query_split.c +1 -1
- data/ext/pg_query/src_backend_nodes_nodes.c +38 -0
- data/ext/pg_query/src_backend_utils_error_elog.c +17 -152
- data/ext/pg_query/src_backend_utils_init_globals.c +1 -1
- data/ext/pg_query/src_backend_utils_mb_mbutils.c +8 -63
- data/ext/pg_query/src_backend_utils_misc_guc_tables.c +0 -2
- data/ext/pg_query/src_port_pg_bitutils.c +78 -4
- data/ext/pg_query/src_port_snprintf.c +3 -3
- data/ext/pg_query/src_port_strlcpy.c +79 -0
- data/lib/pg_query/fingerprint.rb +2 -3
- data/lib/pg_query/node.rb +16 -11
- data/lib/pg_query/parse.rb +1 -1
- data/lib/pg_query/pg_query_pb.rb +1 -1
- data/lib/pg_query/treewalker.rb +16 -3
- data/lib/pg_query/version.rb +1 -1
- metadata +424 -394
- data/ext/pg_query/guc-file.c +0 -0
- data/ext/pg_query/include/common/ip.h +0 -33
- data/ext/pg_query/include/pg_config_os.h +0 -8
- data/ext/pg_query/include/postmaster/auxprocess.h +0 -20
- data/ext/pg_query/include/postmaster/fork_process.h +0 -17
- data/ext/pg_query/include/src_backend_nodes_copyfuncs.funcs.c +0 -5321
- data/ext/pg_query/include/src_backend_nodes_equalfuncs.funcs.c +0 -3354
- data/ext/pg_query/include/utils/pidfile.h +0 -56
- data/ext/pg_query/src_backend_postmaster_postmaster.c +0 -2220
- data/ext/pg_query/src_port_strnlen.c +0 -39
- /data/ext/pg_query/include/{access → postgres/access}/amapi.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/attmap.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/attnum.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/clog.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/commit_ts.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/detoast.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/genam.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/gin.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/htup.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/htup_details.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/itup.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/parallel.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/printtup.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/relation.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/relscan.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/rmgr.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/rmgrlist.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/sdir.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/skey.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/stratnum.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/sysattr.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/table.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/tableam.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/toast_compression.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/transam.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/tsmapi.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/tupconvert.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/tupdesc.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/tupmacs.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/twophase.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/xact.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/xlog.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/xlog_internal.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/xlogbackup.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/xlogdefs.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/xlogprefetcher.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/xlogreader.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/xlogrecord.h +0 -0
- /data/ext/pg_query/include/{access → postgres/access}/xlogrecovery.h +0 -0
- /data/ext/pg_query/include/{archive → postgres/archive}/archive_module.h +0 -0
- /data/ext/pg_query/include/{c.h → postgres/c.h} +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/catalog.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/catversion.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/dependency.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/genbki.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/index.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/indexing.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/namespace.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/objectaccess.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/objectaddress.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_aggregate.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_aggregate_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_am.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_am_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_attribute.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_attribute_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_authid.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_authid_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_class.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_class_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_collation.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_collation_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_constraint.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_constraint_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_control.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_conversion.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_conversion_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_database.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_database_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_depend.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_depend_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_event_trigger.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_event_trigger_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_index.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_index_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_language.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_language_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_namespace.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_namespace_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_opclass.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_opclass_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_operator.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_operator_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_opfamily.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_opfamily_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_partitioned_table.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_partitioned_table_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_proc.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_proc_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_publication.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_publication_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_replication_origin.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_replication_origin_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_statistic.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_statistic_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_statistic_ext.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_statistic_ext_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_transform.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_transform_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_trigger.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_trigger_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_config.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_config_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_dict.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_dict_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_parser.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_parser_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_template.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_ts_template_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_type.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/pg_type_d.h +0 -0
- /data/ext/pg_query/include/{catalog → postgres/catalog}/storage.h +0 -0
- /data/ext/pg_query/include/{commands → postgres/commands}/async.h +0 -0
- /data/ext/pg_query/include/{commands → postgres/commands}/dbcommands.h +0 -0
- /data/ext/pg_query/include/{commands → postgres/commands}/defrem.h +0 -0
- /data/ext/pg_query/include/{commands → postgres/commands}/event_trigger.h +0 -0
- /data/ext/pg_query/include/{commands → postgres/commands}/explain.h +0 -0
- /data/ext/pg_query/include/{commands → postgres/commands}/prepare.h +0 -0
- /data/ext/pg_query/include/{commands → postgres/commands}/tablespace.h +0 -0
- /data/ext/pg_query/include/{commands → postgres/commands}/trigger.h +0 -0
- /data/ext/pg_query/include/{commands → postgres/commands}/user.h +0 -0
- /data/ext/pg_query/include/{commands → postgres/commands}/vacuum.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/cryptohash.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/file_perm.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/hashfn.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/int.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/keywords.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/kwlookup.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/pg_prng.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/relpath.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/scram-common.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/sha2.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/string.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/unicode_east_asian_fw_table.h +0 -0
- /data/ext/pg_query/include/{common → postgres/common}/unicode_nonspacing_table.h +0 -0
- /data/ext/pg_query/include/{copyfuncs.funcs.c → postgres/copyfuncs.funcs.c} +0 -0
- /data/ext/pg_query/include/{copyfuncs.switch.c → postgres/copyfuncs.switch.c} +0 -0
- /data/ext/pg_query/include/{datatype → postgres/datatype}/timestamp.h +0 -0
- /data/ext/pg_query/include/{equalfuncs.funcs.c → postgres/equalfuncs.funcs.c} +0 -0
- /data/ext/pg_query/include/{equalfuncs.switch.c → postgres/equalfuncs.switch.c} +0 -0
- /data/ext/pg_query/include/{executor → postgres/executor}/execdesc.h +0 -0
- /data/ext/pg_query/include/{executor → postgres/executor}/executor.h +0 -0
- /data/ext/pg_query/include/{executor → postgres/executor}/functions.h +0 -0
- /data/ext/pg_query/include/{executor → postgres/executor}/instrument.h +0 -0
- /data/ext/pg_query/include/{executor → postgres/executor}/spi.h +0 -0
- /data/ext/pg_query/include/{executor → postgres/executor}/tablefunc.h +0 -0
- /data/ext/pg_query/include/{executor → postgres/executor}/tuptable.h +0 -0
- /data/ext/pg_query/include/{fmgr.h → postgres/fmgr.h} +0 -0
- /data/ext/pg_query/include/{foreign → postgres/foreign}/fdwapi.h +0 -0
- /data/ext/pg_query/include/{funcapi.h → postgres/funcapi.h} +0 -0
- /data/ext/pg_query/include/{gram.h → postgres/gram.h} +0 -0
- /data/ext/pg_query/include/{gramparse.h → postgres/gramparse.h} +0 -0
- /data/ext/pg_query/include/{jit → postgres/jit}/jit.h +0 -0
- /data/ext/pg_query/include/{kwlist_d.h → postgres/kwlist_d.h} +0 -0
- /data/ext/pg_query/include/{lib → postgres/lib}/dshash.h +0 -0
- /data/ext/pg_query/include/{lib → postgres/lib}/ilist.h +0 -0
- /data/ext/pg_query/include/{lib → postgres/lib}/pairingheap.h +0 -0
- /data/ext/pg_query/include/{lib → postgres/lib}/simplehash.h +0 -0
- /data/ext/pg_query/include/{lib → postgres/lib}/sort_template.h +0 -0
- /data/ext/pg_query/include/{lib → postgres/lib}/stringinfo.h +0 -0
- /data/ext/pg_query/include/{libpq → postgres/libpq}/auth.h +0 -0
- /data/ext/pg_query/include/{libpq → postgres/libpq}/crypt.h +0 -0
- /data/ext/pg_query/include/{libpq → postgres/libpq}/hba.h +0 -0
- /data/ext/pg_query/include/{libpq → postgres/libpq}/libpq-be.h +0 -0
- /data/ext/pg_query/include/{libpq → postgres/libpq}/libpq.h +0 -0
- /data/ext/pg_query/include/{libpq → postgres/libpq}/pqcomm.h +0 -0
- /data/ext/pg_query/include/{libpq → postgres/libpq}/pqformat.h +0 -0
- /data/ext/pg_query/include/{libpq → postgres/libpq}/pqsignal.h +0 -0
- /data/ext/pg_query/include/{libpq → postgres/libpq}/sasl.h +0 -0
- /data/ext/pg_query/include/{libpq → postgres/libpq}/scram.h +0 -0
- /data/ext/pg_query/include/{mb → postgres/mb}/pg_wchar.h +0 -0
- /data/ext/pg_query/include/{mb → postgres/mb}/stringinfo_mb.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/bitmapset.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/execnodes.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/extensible.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/lockoptions.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/makefuncs.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/memnodes.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/miscnodes.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/nodeFuncs.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/nodetags.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/params.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/parsenodes.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/pathnodes.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/pg_list.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/plannodes.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/primnodes.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/print.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/queryjumble.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/replnodes.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/supportnodes.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/tidbitmap.h +0 -0
- /data/ext/pg_query/include/{nodes → postgres/nodes}/value.h +0 -0
- /data/ext/pg_query/include/{optimizer → postgres/optimizer}/cost.h +0 -0
- /data/ext/pg_query/include/{optimizer → postgres/optimizer}/geqo.h +0 -0
- /data/ext/pg_query/include/{optimizer → postgres/optimizer}/geqo_gene.h +0 -0
- /data/ext/pg_query/include/{optimizer → postgres/optimizer}/optimizer.h +0 -0
- /data/ext/pg_query/include/{optimizer → postgres/optimizer}/paths.h +0 -0
- /data/ext/pg_query/include/{optimizer → postgres/optimizer}/planmain.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/analyze.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/kwlist.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/parse_agg.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/parse_coerce.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/parse_expr.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/parse_func.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/parse_node.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/parse_oper.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/parse_relation.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/parse_type.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/parsetree.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/scanner.h +0 -0
- /data/ext/pg_query/include/{parser → postgres/parser}/scansup.h +0 -0
- /data/ext/pg_query/include/{partitioning → postgres/partitioning}/partdefs.h +0 -0
- /data/ext/pg_query/include/{pg_config_ext.h → postgres/pg_config_ext.h} +0 -0
- /data/ext/pg_query/include/{pg_config_manual.h → postgres/pg_config_manual.h} +0 -0
- /data/ext/pg_query/include/{pg_getopt.h → postgres/pg_getopt.h} +0 -0
- /data/ext/pg_query/include/{pg_trace.h → postgres/pg_trace.h} +0 -0
- /data/ext/pg_query/include/{pgtime.h → postgres/pgtime.h} +0 -0
- /data/ext/pg_query/include/{pl_reserved_kwlist.h → postgres/pl_reserved_kwlist.h} +0 -0
- /data/ext/pg_query/include/{pl_reserved_kwlist_d.h → postgres/pl_reserved_kwlist_d.h} +0 -0
- /data/ext/pg_query/include/{pl_unreserved_kwlist.h → postgres/pl_unreserved_kwlist.h} +0 -0
- /data/ext/pg_query/include/{pl_unreserved_kwlist_d.h → postgres/pl_unreserved_kwlist_d.h} +0 -0
- /data/ext/pg_query/include/{plerrcodes.h → postgres/plerrcodes.h} +0 -0
- /data/ext/pg_query/include/{port → postgres/port}/atomics/arch-arm.h +0 -0
- /data/ext/pg_query/include/{port → postgres/port}/atomics/arch-ppc.h +0 -0
- /data/ext/pg_query/include/{port → postgres/port}/atomics/arch-x86.h +0 -0
- /data/ext/pg_query/include/{port → postgres/port}/atomics/fallback.h +0 -0
- /data/ext/pg_query/include/{port → postgres/port}/atomics/generic-gcc.h +0 -0
- /data/ext/pg_query/include/{port → postgres/port}/atomics/generic.h +0 -0
- /data/ext/pg_query/include/{port → postgres/port}/atomics.h +0 -0
- /data/ext/pg_query/include/{port → postgres/port}/pg_bitutils.h +0 -0
- /data/ext/pg_query/include/{port → postgres/port}/pg_bswap.h +0 -0
- /data/ext/pg_query/include/{port → postgres/port}/pg_crc32c.h +0 -0
- /data/ext/pg_query/include/{port → postgres/port}/simd.h +0 -0
- /data/ext/pg_query/include/{port.h → postgres/port.h} +0 -0
- /data/ext/pg_query/include/{portability → postgres/portability}/instr_time.h +0 -0
- /data/ext/pg_query/include/{postgres.h → postgres/postgres.h} +0 -0
- /data/ext/pg_query/include/{postgres_ext.h → postgres/postgres_ext.h} +0 -0
- /data/ext/pg_query/include/{postmaster → postgres/postmaster}/autovacuum.h +0 -0
- /data/ext/pg_query/include/{postmaster → postgres/postmaster}/bgworker.h +0 -0
- /data/ext/pg_query/include/{postmaster → postgres/postmaster}/bgworker_internals.h +0 -0
- /data/ext/pg_query/include/{postmaster → postgres/postmaster}/bgwriter.h +0 -0
- /data/ext/pg_query/include/{postmaster → postgres/postmaster}/interrupt.h +0 -0
- /data/ext/pg_query/include/{postmaster → postgres/postmaster}/pgarch.h +0 -0
- /data/ext/pg_query/include/{postmaster → postgres/postmaster}/startup.h +0 -0
- /data/ext/pg_query/include/{postmaster → postgres/postmaster}/syslogger.h +0 -0
- /data/ext/pg_query/include/{postmaster → postgres/postmaster}/walwriter.h +0 -0
- /data/ext/pg_query/include/{regex → postgres/regex}/regex.h +0 -0
- /data/ext/pg_query/include/{replication → postgres/replication}/logicallauncher.h +0 -0
- /data/ext/pg_query/include/{replication → postgres/replication}/logicalproto.h +0 -0
- /data/ext/pg_query/include/{replication → postgres/replication}/logicalworker.h +0 -0
- /data/ext/pg_query/include/{replication → postgres/replication}/origin.h +0 -0
- /data/ext/pg_query/include/{replication → postgres/replication}/reorderbuffer.h +0 -0
- /data/ext/pg_query/include/{replication → postgres/replication}/slot.h +0 -0
- /data/ext/pg_query/include/{replication → postgres/replication}/syncrep.h +0 -0
- /data/ext/pg_query/include/{replication → postgres/replication}/walreceiver.h +0 -0
- /data/ext/pg_query/include/{replication → postgres/replication}/walsender.h +0 -0
- /data/ext/pg_query/include/{rewrite → postgres/rewrite}/prs2lock.h +0 -0
- /data/ext/pg_query/include/{rewrite → postgres/rewrite}/rewriteHandler.h +0 -0
- /data/ext/pg_query/include/{rewrite → postgres/rewrite}/rewriteManip.h +0 -0
- /data/ext/pg_query/include/{rewrite → postgres/rewrite}/rewriteSupport.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/backendid.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/block.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/buf.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/bufmgr.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/bufpage.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/condition_variable.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/dsm.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/dsm_impl.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/fd.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/fileset.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/item.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/itemid.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/itemptr.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/large_object.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/latch.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/lmgr.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/lock.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/lockdefs.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/lwlock.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/lwlocknames.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/off.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/pg_sema.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/pg_shmem.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/pmsignal.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/predicate.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/proc.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/procarray.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/proclist_types.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/procsignal.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/relfilelocator.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/s_lock.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/sharedfileset.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/shm_mq.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/shm_toc.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/shmem.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/sinval.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/sinvaladt.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/smgr.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/spin.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/standby.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/standbydefs.h +0 -0
- /data/ext/pg_query/include/{storage → postgres/storage}/sync.h +0 -0
- /data/ext/pg_query/include/{tcop → postgres/tcop}/cmdtag.h +0 -0
- /data/ext/pg_query/include/{tcop → postgres/tcop}/cmdtaglist.h +0 -0
- /data/ext/pg_query/include/{tcop → postgres/tcop}/deparse_utility.h +0 -0
- /data/ext/pg_query/include/{tcop → postgres/tcop}/dest.h +0 -0
- /data/ext/pg_query/include/{tcop → postgres/tcop}/fastpath.h +0 -0
- /data/ext/pg_query/include/{tcop → postgres/tcop}/pquery.h +0 -0
- /data/ext/pg_query/include/{tcop → postgres/tcop}/utility.h +0 -0
- /data/ext/pg_query/include/{tsearch → postgres/tsearch}/ts_cache.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/acl.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/aclchk_internal.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/array.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/backend_progress.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/backend_status.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/bytea.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/catcache.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/date.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/datetime.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/datum.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/dsa.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/errcodes.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/expandeddatum.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/expandedrecord.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/float.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/fmgroids.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/fmgrprotos.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/fmgrtab.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/guc_hooks.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/guc_tables.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/hsearch.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/inval.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/logtape.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/lsyscache.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/memdebug.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/memutils_internal.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/memutils_memorychunk.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/numeric.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/partcache.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/pg_locale.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/pgstat_internal.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/plancache.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/portal.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/probes.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/ps_status.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/queryenvironment.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/regproc.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/rel.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/relcache.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/reltrigger.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/resowner.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/ruleutils.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/sharedtuplestore.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/snapmgr.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/snapshot.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/sortsupport.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/syscache.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/timeout.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/timestamp.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/tuplesort.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/tuplestore.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/typcache.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/varlena.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/wait_event.h +0 -0
- /data/ext/pg_query/include/{utils → postgres/utils}/xml.h +0 -0
- /data/ext/pg_query/include/{varatt.h → postgres/varatt.h} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b7ecf94b691013f4f32e593af1a9626f26bfe148bbb6482c4d4d3d92758aadec
|
|
4
|
+
data.tar.gz: 554972dda2feecab635e154c1134d6da4fe7ce136c44ce7c3dea4c6e0b5d3a4c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2f09d9bf624acd8e13fdfcc975871c2e9d184a10fc7630af8a060e9a97cdfffba749145d4be1b6ec75cde4be42a5629c26545bf6b1ba6617d3354228e191d7b1
|
|
7
|
+
data.tar.gz: 602ca65b8c7f700dba44a7d2ed0b13d41953cf053d101b07d1766564b9fd34db687c6321e320c6f54977ee1be21032ceae29ec69be1b5d7eb3d3cde26ead1f1a
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
* ...
|
|
6
6
|
|
|
7
|
+
## 5.1.0 2024-01-09
|
|
8
|
+
|
|
9
|
+
* Update to libpg_query 16-5.1.0
|
|
10
|
+
- Add support for running on Windows
|
|
11
|
+
- Add support for compiling on 32-bit systems
|
|
12
|
+
* Treewalker: Allow passing a block with a single argument to walk!
|
|
13
|
+
* PgQuery::Node: Add inner and inner= helpers to get/set inner object
|
|
14
|
+
|
|
15
|
+
|
|
7
16
|
## 5.0.0 2023-12-22
|
|
8
17
|
|
|
9
18
|
* Upgrade to libpg_query 16-5.0.0
|
data/Rakefile
CHANGED
|
@@ -5,8 +5,8 @@ require 'rspec/core/rake_task'
|
|
|
5
5
|
require 'rubocop/rake_task'
|
|
6
6
|
require 'open-uri'
|
|
7
7
|
|
|
8
|
-
LIB_PG_QUERY_TAG = '16-5.
|
|
9
|
-
LIB_PG_QUERY_SHA256SUM = '
|
|
8
|
+
LIB_PG_QUERY_TAG = '16-5.1.0'.freeze
|
|
9
|
+
LIB_PG_QUERY_SHA256SUM = '31f25b573da1c966bc762b0313b0a50cdd03aabdbaf666d90469eddcb1656df7'.freeze
|
|
10
10
|
|
|
11
11
|
Rake::ExtensionTask.new 'pg_query' do |ext|
|
|
12
12
|
ext.lib_dir = 'lib/pg_query'
|
|
@@ -62,11 +62,10 @@ task :update_source do
|
|
|
62
62
|
# Reduce everything down to one directory
|
|
63
63
|
system("mkdir -p #{extdir}")
|
|
64
64
|
system("cp -a #{libdir}/src/* #{extdir}/")
|
|
65
|
+
system("mv #{extdir}/postgres/include #{extdir}/include/postgres")
|
|
65
66
|
system("mv #{extdir}/postgres/* #{extdir}/")
|
|
66
67
|
system("rmdir #{extdir}/postgres")
|
|
67
68
|
system("cp -a #{libdir}/pg_query.h #{extdir}/include")
|
|
68
|
-
# Make sure every .c file in the top-level directory is its own translation unit
|
|
69
|
-
system("mv #{extdir}/*{_conds,_defs,_helper,.funcs}.c #{extdir}/include")
|
|
70
69
|
# Protobuf definitions
|
|
71
70
|
system("protoc --proto_path=#{libdir}/protobuf --ruby_out=#{File.join(__dir__, 'lib/pg_query')} #{libdir}/protobuf/pg_query.proto")
|
|
72
71
|
system("mkdir -p #{extdir}/include/protobuf")
|
data/ext/pg_query/extconf.rb
CHANGED
|
@@ -7,20 +7,30 @@ require 'pathname'
|
|
|
7
7
|
|
|
8
8
|
$objs = Dir.glob(File.join(__dir__, '*.c')).map { |f| Pathname.new(f).sub_ext('.o').to_s }
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
if RUBY_PLATFORM !~ /cygwin|mswin|mingw|bccwin|wince|emx/
|
|
11
|
+
$CFLAGS << " -fvisibility=hidden -O3 -Wall -fno-strict-aliasing -fwrapv -fstack-protector -Wno-unused-function -Wno-unused-variable -Wno-clobbered -Wno-sign-compare -Wno-discarded-qualifiers -Wno-unknown-warning-option -g"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
$INCFLAGS = "-I#{File.join(__dir__, 'include')} " + "-I#{File.join(__dir__, 'include', 'postgres')} " + $INCFLAGS
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
if RUBY_PLATFORM =~ /cygwin|mswin|mingw|bccwin|wince|emx/
|
|
17
|
+
$INCFLAGS = "-I#{File.join(__dir__, 'include', 'postgres', 'port', 'win32')} " + $INCFLAGS
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
if RUBY_PLATFORM =~ /mswin/
|
|
21
|
+
$INCFLAGS = "-I#{File.join(__dir__, 'include', 'postgres', 'port', 'win32_msvc')} " + $INCFLAGS
|
|
22
|
+
end
|
|
13
23
|
|
|
14
24
|
SYMFILE =
|
|
15
25
|
if RUBY_PLATFORM =~ /freebsd/
|
|
16
26
|
File.join(__dir__, 'pg_query_ruby_freebsd.sym')
|
|
17
|
-
|
|
27
|
+
elsif RUBY_PLATFORM !~ /cygwin|mswin|mingw|bccwin|wince|emx/
|
|
18
28
|
File.join(__dir__, 'pg_query_ruby.sym')
|
|
19
29
|
end
|
|
20
30
|
|
|
21
31
|
if RUBY_PLATFORM =~ /darwin/
|
|
22
32
|
$DLDFLAGS << " -Wl,-exported_symbols_list #{SYMFILE}" unless defined?(::Rubinius)
|
|
23
|
-
|
|
33
|
+
elsif RUBY_PLATFORM !~ /cygwin|mswin|mingw|bccwin|wince|emx/
|
|
24
34
|
$DLDFLAGS << " -Wl,--retain-symbols-file=#{SYMFILE}"
|
|
25
35
|
end
|
|
26
36
|
|
|
@@ -5894,7 +5894,7 @@ _fingerprintRTEPermissionInfo(FingerprintContext *ctx, const RTEPermissionInfo *
|
|
|
5894
5894
|
|
|
5895
5895
|
if (node->requiredPerms != 0) {
|
|
5896
5896
|
char buffer[50];
|
|
5897
|
-
sprintf(buffer,
|
|
5897
|
+
sprintf(buffer, UINT64_FORMAT, node->requiredPerms);
|
|
5898
5898
|
_fingerprintString(ctx, "requiredPerms");
|
|
5899
5899
|
_fingerprintString(ctx, buffer);
|
|
5900
5900
|
}
|
|
@@ -1240,7 +1240,7 @@ _outRTEPermissionInfo(OUT_TYPE(RTEPermissionInfo, RTEPermissionInfo) out, const
|
|
|
1240
1240
|
{
|
|
1241
1241
|
WRITE_UINT_FIELD(relid, relid, relid);
|
|
1242
1242
|
WRITE_BOOL_FIELD(inh, inh, inh);
|
|
1243
|
-
|
|
1243
|
+
WRITE_UINT64_FIELD(required_perms, requiredPerms, requiredPerms);
|
|
1244
1244
|
WRITE_UINT_FIELD(check_as_user, checkAsUser, checkAsUser);
|
|
1245
1245
|
WRITE_BITMAPSET_FIELD(selected_cols, selectedCols, selectedCols);
|
|
1246
1246
|
WRITE_BITMAPSET_FIELD(inserted_cols, insertedCols, insertedCols);
|
|
@@ -1419,7 +1419,7 @@ _readRTEPermissionInfo(OUT_TYPE(RTEPermissionInfo, RTEPermissionInfo) msg)
|
|
|
1419
1419
|
RTEPermissionInfo *node = makeNode(RTEPermissionInfo);
|
|
1420
1420
|
READ_UINT_FIELD(relid, relid, relid);
|
|
1421
1421
|
READ_BOOL_FIELD(inh, inh, inh);
|
|
1422
|
-
|
|
1422
|
+
READ_UINT64_FIELD(required_perms, requiredPerms, requiredPerms);
|
|
1423
1423
|
READ_UINT_FIELD(check_as_user, checkAsUser, checkAsUser);
|
|
1424
1424
|
READ_BITMAPSET_FIELD(selected_cols, selectedCols, selectedCols);
|
|
1425
1425
|
READ_BITMAPSET_FIELD(inserted_cols, insertedCols, insertedCols);
|
|
@@ -167,7 +167,7 @@ extern PGDLLIMPORT bool IsUnderPostmaster;
|
|
|
167
167
|
extern PGDLLIMPORT bool IsBackgroundWorker;
|
|
168
168
|
extern PGDLLIMPORT bool IsBinaryUpgrade;
|
|
169
169
|
|
|
170
|
-
extern PGDLLIMPORT __thread
|
|
170
|
+
extern PGDLLIMPORT __thread bool ExitOnAnyError;
|
|
171
171
|
|
|
172
172
|
extern PGDLLIMPORT char *DataDir;
|
|
173
173
|
extern PGDLLIMPORT int data_directory_mode;
|
|
@@ -161,7 +161,7 @@ typedef struct Node
|
|
|
161
161
|
* Fortunately, this macro isn't recursive so we just define
|
|
162
162
|
* a global variable for this purpose.
|
|
163
163
|
*/
|
|
164
|
-
extern PGDLLIMPORT Node *newNodeMacroHolder;
|
|
164
|
+
extern PGDLLIMPORT __thread Node *newNodeMacroHolder;
|
|
165
165
|
|
|
166
166
|
#define newNode(size, tag) \
|
|
167
167
|
( \
|
|
@@ -53,9 +53,9 @@ typedef enum
|
|
|
53
53
|
} BackslashQuoteType;
|
|
54
54
|
|
|
55
55
|
/* GUC variables in scan.l (every one of these is a bad idea :-() */
|
|
56
|
-
extern PGDLLIMPORT __thread
|
|
57
|
-
extern PGDLLIMPORT __thread
|
|
58
|
-
extern PGDLLIMPORT __thread
|
|
56
|
+
extern PGDLLIMPORT __thread int backslash_quote;
|
|
57
|
+
extern PGDLLIMPORT __thread bool escape_string_warning;
|
|
58
|
+
extern PGDLLIMPORT __thread bool standard_conforming_strings;
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
/* Primary entry point for the raw parsing functions */
|
|
@@ -650,7 +650,7 @@
|
|
|
650
650
|
#define PG_VERSION_NUM 160001
|
|
651
651
|
|
|
652
652
|
/* A string containing the version number, platform, and C compiler */
|
|
653
|
-
#define PG_VERSION_STR "PostgreSQL 16.1
|
|
653
|
+
#define PG_VERSION_STR "PostgreSQL 16.1 (libpg_query)"
|
|
654
654
|
|
|
655
655
|
/* Define to 1 to allow profiling output to be saved separately for each
|
|
656
656
|
process. */
|
|
@@ -826,18 +826,152 @@
|
|
|
826
826
|
|
|
827
827
|
/* Define to how the compiler spells `typeof'. */
|
|
828
828
|
/* #undef typeof */
|
|
829
|
+
/* This causes compatibility problems on some Linux distros, with "xlocale.h" not being available */
|
|
829
830
|
#undef HAVE_LOCALE_T
|
|
830
831
|
#undef LOCALE_T_IN_XLOCALE
|
|
831
832
|
#undef WCSTOMBS_L_IN_XLOCALE
|
|
832
|
-
|
|
833
|
+
|
|
834
|
+
/* Support gcc earlier than 4.6.0 and MSVC */
|
|
833
835
|
#undef HAVE__STATIC_ASSERT
|
|
836
|
+
|
|
837
|
+
/* Avoid dependency on execinfo (requires extra library on musl-libc based systems, not supported on Windows) */
|
|
834
838
|
#undef HAVE_EXECINFO_H
|
|
835
839
|
#undef HAVE_BACKTRACE_SYMBOLS
|
|
840
|
+
|
|
841
|
+
/* Avoid dependency on hardware popcount instructions (POPQNTQ) on x86 */
|
|
836
842
|
#undef HAVE_X86_64_POPCNTQ
|
|
843
|
+
|
|
844
|
+
/* Avoid dependency on cpuid.h (only supported on x86 systems) */
|
|
837
845
|
#undef HAVE__GET_CPUID
|
|
846
|
+
|
|
847
|
+
/* Avoid CRC extension usage to ensure we are not architecture-dependent */
|
|
838
848
|
#undef USE_ARMV8_CRC32C
|
|
839
849
|
#undef USE_SSE42_CRC32C_WITH_RUNTIME_CHECK
|
|
850
|
+
|
|
851
|
+
/* Ensure we do not fail on systems that have strchrnul support (FreeBSD, NetBSD and newer glibc) */
|
|
840
852
|
#include <stdlib.h>
|
|
841
853
|
#if defined(__FreeBSD__) || defined(__NetBSD__) || (defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 38) || __GLIBC__ > 2))
|
|
842
854
|
#define HAVE_STRCHRNUL
|
|
843
855
|
#endif
|
|
856
|
+
|
|
857
|
+
/* 32-bit */
|
|
858
|
+
#if defined(_WIN32) || __SIZEOF_POINTER__ == 4
|
|
859
|
+
#undef ALIGNOF_DOUBLE
|
|
860
|
+
#define ALIGNOF_DOUBLE 4
|
|
861
|
+
#undef ALIGNOF_LONG
|
|
862
|
+
#define ALIGNOF_LONG 4
|
|
863
|
+
#define ALIGNOF_LONG_LONG_INT 4
|
|
864
|
+
#undef ALIGNOF_PG_INT128_TYPE
|
|
865
|
+
#undef HAVE_LONG_INT_64
|
|
866
|
+
#define HAVE_LONG_LONG_INT_64 1
|
|
867
|
+
#undef INT64_MODIFIER
|
|
868
|
+
#define INT64_MODIFIER "ll"
|
|
869
|
+
#undef PG_INT128_TYPE
|
|
870
|
+
#undef PG_INT64_TYPE
|
|
871
|
+
#define PG_INT64_TYPE long long int
|
|
872
|
+
#undef SIZEOF_LONG
|
|
873
|
+
#define SIZEOF_LONG 4
|
|
874
|
+
#undef SIZEOF_OFF_T
|
|
875
|
+
#define SIZEOF_OFF_T 4
|
|
876
|
+
#undef SIZEOF_SIZE_T
|
|
877
|
+
#define SIZEOF_SIZE_T 4
|
|
878
|
+
#undef SIZEOF_VOID_P
|
|
879
|
+
#define SIZEOF_VOID_P 4
|
|
880
|
+
#endif
|
|
881
|
+
|
|
882
|
+
/* Windows */
|
|
883
|
+
#if defined(_WIN32) || defined(_WIN64)
|
|
884
|
+
#undef HAVE_COPYFILE
|
|
885
|
+
#undef HAVE_COPYFILE_H
|
|
886
|
+
#undef HAVE_DECL_F_FULLFSYNC
|
|
887
|
+
#define HAVE_DECL_F_FULLFSYNC 0
|
|
888
|
+
#undef HAVE_DECL_PREADV
|
|
889
|
+
#define HAVE_DECL_PREADV 0
|
|
890
|
+
#undef HAVE_DECL_PWRITEV
|
|
891
|
+
#define HAVE_DECL_PWRITEV 0
|
|
892
|
+
#undef HAVE_DECL_STRLCAT
|
|
893
|
+
#define HAVE_DECL_STRLCAT 0
|
|
894
|
+
#undef HAVE_DECL_STRLCPY
|
|
895
|
+
#define HAVE_DECL_STRLCPY 0
|
|
896
|
+
#undef HAVE_GETIFADDRS
|
|
897
|
+
#undef HAVE_GETPEEREID
|
|
898
|
+
#undef HAVE_IFADDRS_H
|
|
899
|
+
#undef HAVE_INET_ATON
|
|
900
|
+
#undef HAVE_INT_OPTRESET
|
|
901
|
+
#undef HAVE_KQUEUE
|
|
902
|
+
#undef HAVE_LANGINFO_H
|
|
903
|
+
#undef HAVE_MEMSET_S
|
|
904
|
+
#undef HAVE_MKDTEMP
|
|
905
|
+
#undef HAVE_PTHREAD
|
|
906
|
+
#undef HAVE_PTHREAD_BARRIER_WAIT
|
|
907
|
+
#undef HAVE_PTHREAD_IS_THREADED_NP
|
|
908
|
+
#undef HAVE_PTHREAD_PRIO_INHERIT
|
|
909
|
+
#undef HAVE_STRERROR_R
|
|
910
|
+
#undef HAVE_STRLCAT
|
|
911
|
+
#undef HAVE_STRLCPY
|
|
912
|
+
#undef HAVE_STRSIGNAL
|
|
913
|
+
#undef HAVE_STRUCT_SOCKADDR_SA_LEN
|
|
914
|
+
#undef HAVE_STRUCT_TM_TM_ZONE
|
|
915
|
+
#undef HAVE_SYSLOG
|
|
916
|
+
#undef HAVE_SYS_EVENT_H
|
|
917
|
+
#undef HAVE_SYS_UCRED_H
|
|
918
|
+
#undef HAVE_TERMIOS_H
|
|
919
|
+
#undef HAVE_UNION_SEMUN
|
|
920
|
+
#undef HAVE_USELOCALE
|
|
921
|
+
#define HAVE__CONFIGTHREADLOCALE 1
|
|
922
|
+
#undef STRERROR_R_INT
|
|
923
|
+
#undef USE_SYSV_SEMAPHORES
|
|
924
|
+
#undef USE_SYSV_SHARED_MEMORY
|
|
925
|
+
#define USE_WIN32_SEMAPHORES 1
|
|
926
|
+
#define USE_WIN32_SHARED_MEMORY 1
|
|
927
|
+
#undef PG_PRINTF_ATTRIBUTE
|
|
928
|
+
#if defined(__clang__)
|
|
929
|
+
#define PG_PRINTF_ATTRIBUTE printf
|
|
930
|
+
#elif defined(__MINGW32__) || defined(__MINGW64__) || defined(__MSYS__) || defined(__CYGWIN__)
|
|
931
|
+
#define PG_PRINTF_ATTRIBUTE gnu_printf
|
|
932
|
+
#endif
|
|
933
|
+
#if defined(__MINGW32__) || defined(__MINGW64__) || defined(__MSYS__) || defined(__CYGWIN__)
|
|
934
|
+
#undef HAVE_MBSTOWCS_L
|
|
935
|
+
#undef HAVE_WCSTOMBS_L
|
|
936
|
+
#define HAVE_CRTDEFS_H 1
|
|
937
|
+
#define HAVE_PTHREAD_BARRIER_WAIT 1
|
|
938
|
+
#endif
|
|
939
|
+
#endif
|
|
940
|
+
|
|
941
|
+
/* Microsoft Visual Studio Compiler */
|
|
942
|
+
#ifdef _MSC_VER
|
|
943
|
+
#undef HAVE_COMPUTED_GOTO
|
|
944
|
+
#undef HAVE_GCC__ATOMIC_INT32_CAS
|
|
945
|
+
#undef HAVE_GCC__ATOMIC_INT64_CAS
|
|
946
|
+
#undef HAVE_GCC__SYNC_CHAR_TAS
|
|
947
|
+
#undef HAVE_GCC__SYNC_INT32_CAS
|
|
948
|
+
#undef HAVE_GCC__SYNC_INT32_TAS
|
|
949
|
+
#undef HAVE_GCC__SYNC_INT64_CAS
|
|
950
|
+
#undef HAVE_GETOPT
|
|
951
|
+
#undef HAVE_GETOPT_H
|
|
952
|
+
#undef HAVE_GETOPT_LONG
|
|
953
|
+
#undef HAVE_INTTYPES_H
|
|
954
|
+
#undef HAVE_INT_OPTERR
|
|
955
|
+
#undef HAVE_LIBM
|
|
956
|
+
#undef HAVE_STRINGS_H
|
|
957
|
+
#undef HAVE_STRUCT_OPTION
|
|
958
|
+
#undef HAVE_TYPEOF
|
|
959
|
+
#undef HAVE_VISIBILITY_ATTRIBUTE
|
|
960
|
+
#undef HAVE__BOOL
|
|
961
|
+
#undef HAVE__BUILTIN_BSWAP16
|
|
962
|
+
#undef HAVE__BUILTIN_BSWAP32
|
|
963
|
+
#undef HAVE__BUILTIN_BSWAP64
|
|
964
|
+
#undef HAVE__BUILTIN_CLZ
|
|
965
|
+
#undef HAVE__BUILTIN_CONSTANT_P
|
|
966
|
+
#undef HAVE__BUILTIN_CTZ
|
|
967
|
+
#undef HAVE__BUILTIN_FRAME_ADDRESS
|
|
968
|
+
#undef HAVE__BUILTIN_OP_OVERFLOW
|
|
969
|
+
#undef HAVE__BUILTIN_POPCOUNT
|
|
970
|
+
#undef HAVE__BUILTIN_TYPES_COMPATIBLE_P
|
|
971
|
+
#undef HAVE__BUILTIN_UNREACHABLE
|
|
972
|
+
#ifndef __cplusplus
|
|
973
|
+
#define inline __inline
|
|
974
|
+
#endif
|
|
975
|
+
#undef restrict
|
|
976
|
+
#define __thread __declspec( thread )
|
|
977
|
+
#endif
|
|
@@ -764,7 +764,7 @@ extern PGDLLIMPORT PgStat_Counter pgStatActiveTime;
|
|
|
764
764
|
extern PGDLLIMPORT PgStat_Counter pgStatTransactionIdleTime;
|
|
765
765
|
|
|
766
766
|
/* updated by the traffic cop and in errfinish() */
|
|
767
|
-
extern PGDLLIMPORT __thread
|
|
767
|
+
extern PGDLLIMPORT __thread SessionEndType pgStatSessionEndCause;
|
|
768
768
|
|
|
769
769
|
|
|
770
770
|
/*
|
|
@@ -367,7 +367,7 @@ typedef union YYSTYPE
|
|
|
367
367
|
# define YYSTYPE_IS_TRIVIAL 1
|
|
368
368
|
#endif
|
|
369
369
|
|
|
370
|
-
extern __thread
|
|
370
|
+
extern __thread YYSTYPE plpgsql_yylval;
|
|
371
371
|
|
|
372
372
|
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
|
373
373
|
typedef struct YYLTYPE
|
|
@@ -382,4 +382,4 @@ typedef struct YYLTYPE
|
|
|
382
382
|
# define YYLTYPE_IS_TRIVIAL 1
|
|
383
383
|
#endif
|
|
384
384
|
|
|
385
|
-
extern __thread
|
|
385
|
+
extern __thread YYLTYPE plpgsql_yylloc;
|
|
@@ -1191,11 +1191,11 @@ typedef enum
|
|
|
1191
1191
|
IDENTIFIER_LOOKUP_EXPR /* In SQL expression --- special case */
|
|
1192
1192
|
} IdentifierLookup;
|
|
1193
1193
|
|
|
1194
|
-
extern __thread
|
|
1194
|
+
extern __thread IdentifierLookup plpgsql_IdentifierLookup;
|
|
1195
1195
|
|
|
1196
|
-
extern __thread
|
|
1196
|
+
extern __thread int plpgsql_variable_conflict;
|
|
1197
1197
|
|
|
1198
|
-
extern __thread
|
|
1198
|
+
extern __thread bool plpgsql_print_strict_params;
|
|
1199
1199
|
|
|
1200
1200
|
extern bool plpgsql_check_asserts;
|
|
1201
1201
|
|
|
@@ -1209,18 +1209,18 @@ extern bool plpgsql_check_asserts;
|
|
|
1209
1209
|
extern int plpgsql_extra_warnings;
|
|
1210
1210
|
extern int plpgsql_extra_errors;
|
|
1211
1211
|
|
|
1212
|
-
extern __thread
|
|
1213
|
-
extern __thread
|
|
1212
|
+
extern __thread bool plpgsql_check_syntax;
|
|
1213
|
+
extern __thread bool plpgsql_DumpExecTree;
|
|
1214
1214
|
|
|
1215
|
-
extern __thread
|
|
1215
|
+
extern __thread PLpgSQL_stmt_block *plpgsql_parse_result;
|
|
1216
1216
|
|
|
1217
|
-
extern __thread
|
|
1218
|
-
extern __thread
|
|
1217
|
+
extern __thread int plpgsql_nDatums;
|
|
1218
|
+
extern __thread PLpgSQL_datum **plpgsql_Datums;
|
|
1219
1219
|
|
|
1220
|
-
extern __thread
|
|
1220
|
+
extern __thread char *plpgsql_error_funcname;
|
|
1221
1221
|
|
|
1222
|
-
extern __thread
|
|
1223
|
-
extern __thread
|
|
1222
|
+
extern __thread PLpgSQL_function *plpgsql_curr_compile;
|
|
1223
|
+
extern __thread MemoryContext plpgsql_compile_tmp_cxt;
|
|
1224
1224
|
|
|
1225
1225
|
extern PLpgSQL_plugin **plpgsql_plugin_ptr;
|
|
1226
1226
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*-------------------------------------------------------------------------
|
|
2
|
+
*
|
|
3
|
+
* arch-hppa.h
|
|
4
|
+
* Atomic operations considerations specific to HPPA
|
|
5
|
+
*
|
|
6
|
+
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
|
7
|
+
* Portions Copyright (c) 1994, Regents of the University of California
|
|
8
|
+
*
|
|
9
|
+
* NOTES:
|
|
10
|
+
*
|
|
11
|
+
* src/include/port/atomics/arch-hppa.h
|
|
12
|
+
*
|
|
13
|
+
*-------------------------------------------------------------------------
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/* HPPA doesn't do either read or write reordering */
|
|
17
|
+
#define pg_memory_barrier_impl() pg_compiler_barrier_impl()
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*-------------------------------------------------------------------------
|
|
2
|
+
*
|
|
3
|
+
* generic-msvc.h
|
|
4
|
+
* Atomic operations support when using MSVC
|
|
5
|
+
*
|
|
6
|
+
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
|
7
|
+
* Portions Copyright (c) 1994, Regents of the University of California
|
|
8
|
+
*
|
|
9
|
+
* NOTES:
|
|
10
|
+
*
|
|
11
|
+
* Documentation:
|
|
12
|
+
* * Interlocked Variable Access
|
|
13
|
+
* http://msdn.microsoft.com/en-us/library/ms684122%28VS.85%29.aspx
|
|
14
|
+
*
|
|
15
|
+
* src/include/port/atomics/generic-msvc.h
|
|
16
|
+
*
|
|
17
|
+
*-------------------------------------------------------------------------
|
|
18
|
+
*/
|
|
19
|
+
#include <intrin.h>
|
|
20
|
+
|
|
21
|
+
/* intentionally no include guards, should only be included by atomics.h */
|
|
22
|
+
#ifndef INSIDE_ATOMICS_H
|
|
23
|
+
#error "should be included via atomics.h"
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
#pragma intrinsic(_ReadWriteBarrier)
|
|
27
|
+
#define pg_compiler_barrier_impl() _ReadWriteBarrier()
|
|
28
|
+
|
|
29
|
+
#ifndef pg_memory_barrier_impl
|
|
30
|
+
#define pg_memory_barrier_impl() MemoryBarrier()
|
|
31
|
+
#endif
|
|
32
|
+
|
|
33
|
+
#if defined(HAVE_ATOMICS)
|
|
34
|
+
|
|
35
|
+
#define PG_HAVE_ATOMIC_U32_SUPPORT
|
|
36
|
+
typedef struct pg_atomic_uint32
|
|
37
|
+
{
|
|
38
|
+
volatile uint32 value;
|
|
39
|
+
} pg_atomic_uint32;
|
|
40
|
+
|
|
41
|
+
#define PG_HAVE_ATOMIC_U64_SUPPORT
|
|
42
|
+
typedef struct pg_attribute_aligned(8) pg_atomic_uint64
|
|
43
|
+
{
|
|
44
|
+
volatile uint64 value;
|
|
45
|
+
} pg_atomic_uint64;
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32
|
|
49
|
+
static inline bool
|
|
50
|
+
pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr,
|
|
51
|
+
uint32 *expected, uint32 newval)
|
|
52
|
+
{
|
|
53
|
+
bool ret;
|
|
54
|
+
uint32 current;
|
|
55
|
+
current = InterlockedCompareExchange(&ptr->value, newval, *expected);
|
|
56
|
+
ret = current == *expected;
|
|
57
|
+
*expected = current;
|
|
58
|
+
return ret;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
#define PG_HAVE_ATOMIC_FETCH_ADD_U32
|
|
62
|
+
static inline uint32
|
|
63
|
+
pg_atomic_fetch_add_u32_impl(volatile pg_atomic_uint32 *ptr, int32 add_)
|
|
64
|
+
{
|
|
65
|
+
return InterlockedExchangeAdd(&ptr->value, add_);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* The non-intrinsics versions are only available in vista upwards, so use the
|
|
70
|
+
* intrinsic version. Only supported on >486, but we require XP as a minimum
|
|
71
|
+
* baseline, which doesn't support the 486, so we don't need to add checks for
|
|
72
|
+
* that case.
|
|
73
|
+
*/
|
|
74
|
+
#pragma intrinsic(_InterlockedCompareExchange64)
|
|
75
|
+
|
|
76
|
+
#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64
|
|
77
|
+
static inline bool
|
|
78
|
+
pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr,
|
|
79
|
+
uint64 *expected, uint64 newval)
|
|
80
|
+
{
|
|
81
|
+
bool ret;
|
|
82
|
+
uint64 current;
|
|
83
|
+
current = _InterlockedCompareExchange64(&ptr->value, newval, *expected);
|
|
84
|
+
ret = current == *expected;
|
|
85
|
+
*expected = current;
|
|
86
|
+
return ret;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Only implemented on 64bit builds */
|
|
90
|
+
#ifdef _WIN64
|
|
91
|
+
#pragma intrinsic(_InterlockedExchangeAdd64)
|
|
92
|
+
|
|
93
|
+
#define PG_HAVE_ATOMIC_FETCH_ADD_U64
|
|
94
|
+
static inline uint64
|
|
95
|
+
pg_atomic_fetch_add_u64_impl(volatile pg_atomic_uint64 *ptr, int64 add_)
|
|
96
|
+
{
|
|
97
|
+
return _InterlockedExchangeAdd64(&ptr->value, add_);
|
|
98
|
+
}
|
|
99
|
+
#endif /* _WIN64 */
|
|
100
|
+
|
|
101
|
+
#endif /* HAVE_ATOMICS */
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*-------------------------------------------------------------------------
|
|
2
|
+
*
|
|
3
|
+
* generic-sunpro.h
|
|
4
|
+
* Atomic operations for solaris' CC
|
|
5
|
+
*
|
|
6
|
+
* Portions Copyright (c) 2013-2023, PostgreSQL Global Development Group
|
|
7
|
+
*
|
|
8
|
+
* NOTES:
|
|
9
|
+
*
|
|
10
|
+
* Documentation:
|
|
11
|
+
* * manpage for atomic_cas(3C)
|
|
12
|
+
* http://www.unix.com/man-page/opensolaris/3c/atomic_cas/
|
|
13
|
+
* http://docs.oracle.com/cd/E23824_01/html/821-1465/atomic-cas-3c.html
|
|
14
|
+
*
|
|
15
|
+
* src/include/port/atomics/generic-sunpro.h
|
|
16
|
+
*
|
|
17
|
+
* -------------------------------------------------------------------------
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#if defined(HAVE_ATOMICS)
|
|
21
|
+
|
|
22
|
+
#ifdef HAVE_MBARRIER_H
|
|
23
|
+
#include <mbarrier.h>
|
|
24
|
+
|
|
25
|
+
#define pg_compiler_barrier_impl() __compiler_barrier()
|
|
26
|
+
|
|
27
|
+
#ifndef pg_memory_barrier_impl
|
|
28
|
+
/*
|
|
29
|
+
* Despite the name this is actually a full barrier. Expanding to mfence/
|
|
30
|
+
* membar #StoreStore | #LoadStore | #StoreLoad | #LoadLoad on x86/sparc
|
|
31
|
+
* respectively.
|
|
32
|
+
*/
|
|
33
|
+
# define pg_memory_barrier_impl() __machine_rw_barrier()
|
|
34
|
+
#endif
|
|
35
|
+
#ifndef pg_read_barrier_impl
|
|
36
|
+
# define pg_read_barrier_impl() __machine_r_barrier()
|
|
37
|
+
#endif
|
|
38
|
+
#ifndef pg_write_barrier_impl
|
|
39
|
+
# define pg_write_barrier_impl() __machine_w_barrier()
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
#endif /* HAVE_MBARRIER_H */
|
|
43
|
+
|
|
44
|
+
/* Older versions of the compiler don't have atomic.h... */
|
|
45
|
+
#ifdef HAVE_ATOMIC_H
|
|
46
|
+
|
|
47
|
+
#include <atomic.h>
|
|
48
|
+
|
|
49
|
+
#define PG_HAVE_ATOMIC_U32_SUPPORT
|
|
50
|
+
typedef struct pg_atomic_uint32
|
|
51
|
+
{
|
|
52
|
+
volatile uint32 value;
|
|
53
|
+
} pg_atomic_uint32;
|
|
54
|
+
|
|
55
|
+
#define PG_HAVE_ATOMIC_U64_SUPPORT
|
|
56
|
+
typedef struct pg_atomic_uint64
|
|
57
|
+
{
|
|
58
|
+
/*
|
|
59
|
+
* Syntax to enforce variable alignment should be supported by versions
|
|
60
|
+
* supporting atomic.h, but it's hard to find accurate documentation. If
|
|
61
|
+
* it proves to be a problem, we'll have to add more version checks for 64
|
|
62
|
+
* bit support.
|
|
63
|
+
*/
|
|
64
|
+
volatile uint64 value pg_attribute_aligned(8);
|
|
65
|
+
} pg_atomic_uint64;
|
|
66
|
+
|
|
67
|
+
#endif /* HAVE_ATOMIC_H */
|
|
68
|
+
|
|
69
|
+
#endif /* defined(HAVE_ATOMICS) */
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
#if defined(HAVE_ATOMICS)
|
|
73
|
+
|
|
74
|
+
#ifdef HAVE_ATOMIC_H
|
|
75
|
+
|
|
76
|
+
#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32
|
|
77
|
+
static inline bool
|
|
78
|
+
pg_atomic_compare_exchange_u32_impl(volatile pg_atomic_uint32 *ptr,
|
|
79
|
+
uint32 *expected, uint32 newval)
|
|
80
|
+
{
|
|
81
|
+
bool ret;
|
|
82
|
+
uint32 current;
|
|
83
|
+
|
|
84
|
+
current = atomic_cas_32(&ptr->value, *expected, newval);
|
|
85
|
+
ret = current == *expected;
|
|
86
|
+
*expected = current;
|
|
87
|
+
return ret;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U64
|
|
91
|
+
static inline bool
|
|
92
|
+
pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr,
|
|
93
|
+
uint64 *expected, uint64 newval)
|
|
94
|
+
{
|
|
95
|
+
bool ret;
|
|
96
|
+
uint64 current;
|
|
97
|
+
|
|
98
|
+
current = atomic_cas_64(&ptr->value, *expected, newval);
|
|
99
|
+
ret = current == *expected;
|
|
100
|
+
*expected = current;
|
|
101
|
+
return ret;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
#endif /* HAVE_ATOMIC_H */
|
|
105
|
+
|
|
106
|
+
#endif /* defined(HAVE_ATOMICS) */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* src/include/port/win32/dlfcn.h */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* src/include/port/win32/grp.h */
|