Skip to content

Commit e9c6412

Browse files
authored
Merge branch 'master' into feat/implicit-for
2 parents f234dc0 + 2836675 commit e9c6412

File tree

43 files changed

+2028
-125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2028
-125
lines changed

.devcontainer/Dockerfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# IvorySQL Build and Test Container - Modern Ubuntu
2+
# Alternative to CentOS with same capabilities
3+
4+
FROM ubuntu:22.04
5+
6+
# Prevent interactive prompts
7+
ENV DEBIAN_FRONTEND=noninteractive
8+
9+
# Install build dependencies matching the workflow requirements
10+
RUN apt-get update && apt-get install -y \
11+
# Build tools
12+
build-essential git lcov bison flex pkg-config cppcheck \
13+
# Core dependencies
14+
libkrb5-dev libssl-dev libldap-dev libpam-dev \
15+
libxml2-dev libxslt-dev libreadline-dev libedit-dev \
16+
zlib1g-dev uuid-dev libossp-uuid-dev libuuid1 e2fsprogs \
17+
# ICU support
18+
libicu-dev \
19+
# Language support
20+
python3-dev tcl-dev libperl-dev gettext \
21+
# Perl test modules
22+
libipc-run-perl libtime-hires-perl libtest-simple-perl \
23+
# LLVM/Clang
24+
llvm clang \
25+
# LZ4 compression
26+
liblz4-dev \
27+
# System libraries
28+
libselinux1-dev libsystemd-dev \
29+
# GSSAPI
30+
libgssapi-krb5-2 \
31+
# Locale support
32+
locales \
33+
# For dev containers
34+
sudo tini \
35+
&& rm -rf /var/lib/apt/lists/*
36+
37+
# Set up locale
38+
RUN locale-gen en_US.UTF-8
39+
ENV LANG=en_US.UTF-8 \
40+
LANGUAGE=en_US:en \
41+
LC_ALL=en_US.UTF-8
42+
43+
# Create ivorysql user with matching host UID/GID (1000:1000)
44+
# and grant sudo privileges without password
45+
ARG USER_UID=1000
46+
ARG USER_GID=1000
47+
RUN groupadd -g ${USER_GID} ivorysql || true && \
48+
useradd -m -u ${USER_UID} -g ${USER_GID} -d /home/ivorysql -s /bin/bash ivorysql && \
49+
echo "ivorysql ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
50+
51+
# Set working directory
52+
WORKDIR /home/ivorysql/IvorySQL
53+
54+
# Switch to ivorysql user for builds
55+
USER ivorysql
56+
57+
# Default command
58+
ENTRYPOINT ["/usr/bin/tini", "--"]
59+
CMD ["/bin/bash"]

.devcontainer/devcontainer.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "IvorySQL Dev",
3+
"dockerComposeFile": "../docker-compose.yaml",
4+
"service": "dev",
5+
"workspaceFolder": "/home/ivorysql/IvorySQL",
6+
"remoteUser": "ivorysql",
7+
"customizations": {
8+
"vscode": {
9+
"settings": {
10+
"terminal.integrated.defaultProfile.linux": "bash",
11+
"C_Cpp.default.configurationProvider": "ms-vscode.makefile-tools"
12+
},
13+
"extensions": [
14+
"ms-vscode.cpptools",
15+
"ms-vscode.makefile-tools",
16+
"twxs.cmake",
17+
"mhutchie.git-graph",
18+
"eamodio.gitlens"
19+
]
20+
}
21+
}
22+
}

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
if: ${{ matrix.os == 'ubuntu-latest' }}
2020
run: |
2121
sudo apt-get update
22+
sudo apt-get install -y gcc-14 g++-14
23+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
24+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
2225
sudo apt-get install -y build-essential git lcov bison flex \
2326
libkrb5-dev libssl-dev libldap-dev libpam-dev python3-dev \
2427
tcl-dev libperl-dev gettext libxml2-dev libxslt-dev \
@@ -35,4 +38,4 @@ jobs:
3538
--with-ossp-uuid --with-libxml --with-libxslt --with-perl \
3639
--with-icu --with-libnuma --enable-injection-points
3740
- name: compile
38-
run: make
41+
run: make CFLAGS="$CFLAGS -Wshadow=compatible-local -Werror=missing-variable-declarations -Werror=maybe-uninitialized -Werror=unused-value -Werror=unused-but-set-variable -Werror=missing-prototypes -Werror=unused-variable"

README.md

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,44 @@ We are committed to abiding by the principles of [open-source ways](https://open
2323
</br>
2424

2525
## Installation
26-
We recommend following our [Quick Start](https://docs.ivorysql.org/en/ivorysql-doc/v5.0/v5.0/3.1#quick-installation) for how to install and running IvorySQL.
26+
We recommend following our [Quick Start](https://docs.ivorysql.org/en/ivorysql-doc/v5.1/v5.1/3.1#quick-installation) for how to install and running IvorySQL.
2727

28-
Furthermore, for more detailed installation instructions, please refer to the [Installation Docs](https://docs.ivorysql.org/en/ivorysql-doc/v5.0/v5.0/4.1#introduction). We provide four installation methods for IvorySQL, as outlined below:
29-
- [Yum installation](https://docs.ivorysql.org/en/ivorysql-doc/v5.0/v5.0/4.1#Yum-installation)
30-
- [Docker installation](https://docs.ivorysql.org/en/ivorysql-doc/v5.0/v5.0/4.1#Docker-installation)
31-
- [Rpm installation](https://docs.ivorysql.org/en/ivorysql-doc/v5.0/v5.0/4.1#Rpm-installation)
32-
- [Source code installation](https://docs.ivorysql.org/en/ivorysql-doc/v5.0/v5.0/4.1#Source-code-installation)
28+
Furthermore, for more detailed installation instructions, please refer to the [Installation Docs](https://docs.ivorysql.org/en/ivorysql-doc/v5.1/v5.1/4.1#introduction). We provide four installation methods for IvorySQL, as outlined below:
29+
- [Yum installation](https://docs.ivorysql.org/en/ivorysql-doc/v5.1/v5.1/4.1#Yum-installation)
30+
- [Docker installation](https://docs.ivorysql.org/en/ivorysql-doc/v5.1/v5.1/4.1#Docker-installation)
31+
- [Rpm installation](https://docs.ivorysql.org/en/ivorysql-doc/v5.1/v5.1/4.1#Rpm-installation)
32+
- [Source code installation](https://docs.ivorysql.org/en/ivorysql-doc/v5.1/v5.1/4.1#Source-code-installation)
33+
34+
## Development with Docker
35+
36+
For a consistent development environment, we provide a Docker-based setup that includes all build dependencies.
37+
38+
### Quick Start
39+
40+
```bash
41+
# Start the development containers
42+
docker compose up -d
43+
44+
# Enter the development container
45+
docker compose exec dev bash
46+
47+
# Configure and build IvorySQL
48+
./configure --prefix=/home/ivorysql/ivorysql \
49+
--enable-debug --enable-cassert \
50+
--with-uuid=e2fs --with-libxml
51+
52+
make -j$(nproc)
53+
make install
54+
55+
# Initialize database in Oracle mode
56+
initdb -D data_ora -m oracle
57+
58+
# Start the server
59+
pg_ctl -D data_ora start
60+
61+
# Run tests
62+
make oracle-check
63+
```
3364

3465
## Developer Formatting hooks and CI:
3566
- A pre-commit formatting hook is provided at `.githooks/pre-commit`. Enable it with `git config core.hooksPath .githooks`, or run `make code-format` (equivalently `bash tools/enable-git-hooks.sh`).

README_CN.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ IvorySQL 项目采用 Apache 2.0 许可协议发布,并鼓励各种形式的
2727
</br>
2828

2929
## 安装
30-
建议参考[快速入门](https://docs.ivorysql.org/cn/ivorysql-doc/v5.0/v5.0/3.1#quick-installation)了解如何安装和运行IvorySQL。
30+
建议参考[快速入门](https://docs.ivorysql.org/cn/ivorysql-doc/v5.1/v5.1/3.1#quick-installation)了解如何安装和运行IvorySQL。
3131

32-
此外,关于更详细的安装说明,请参阅[安装文档](https://docs.ivorysql.org/cn/ivorysql-doc/v5.0/v5.0/4.1#introduction)。我们提供以下四种 IvorySQL 的安装方法:
33-
- [Yum 安装](https://docs.ivorysql.org/cn/ivorysql-doc/v5.0/v5.0/4.1#yum源安装)
34-
- [Docker 安装](https://docs.ivorysql.org/cn/ivorysql-doc/v5.0/v5.0/4.1#docker安装)
35-
- [RPM 安装](https://docs.ivorysql.org/cn/ivorysql-doc/v5.0/v5.0/4.1#rpm安装)
36-
- [源代码安装](https://docs.ivorysql.org/cn/ivorysql-doc/v5.0/v5.0/4.1#源码安装)
32+
此外,关于更详细的安装说明,请参阅[安装文档](https://docs.ivorysql.org/cn/ivorysql-doc/v5.1/v5.1/4.1#introduction)。我们提供以下四种 IvorySQL 的安装方法:
33+
- [Yum 安装](https://docs.ivorysql.org/cn/ivorysql-doc/v5.1/v5.1/4.1#yum源安装)
34+
- [Docker 安装](https://docs.ivorysql.org/cn/ivorysql-doc/v5.1/v5.1/4.1#docker安装)
35+
- [RPM 安装](https://docs.ivorysql.org/cn/ivorysql-doc/v5.1/v5.1/4.1#rpm安装)
36+
- [源代码安装](https://docs.ivorysql.org/cn/ivorysql-doc/v5.1/v5.1/4.1#源码安装)
3737

3838

3939

contrib/gb18030_2022/utf8_and_gb18030_2022.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
PG_MODULE_MAGIC;
2424

25-
gb18030_2022_to_utf8_hook_type pre_gb18030_2022_to_utf8_hook = NULL;
26-
utf8_to_gb18030_2022_hook_type pre_utf8_to_gb18030_2022_hook = NULL;
25+
static gb18030_2022_to_utf8_hook_type pre_gb18030_2022_to_utf8_hook = NULL;
26+
static utf8_to_gb18030_2022_hook_type pre_utf8_to_gb18030_2022_hook = NULL;
2727

2828
int gb18030_2022_to_utf8(const unsigned char *iso, int len,
2929
unsigned char *utf, bool noError);

contrib/ivorysql_ora/src/builtin_functions/datetime_datatype_functions.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static const int month_days[] = {
153153
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
154154
};
155155

156-
const char *const ora_days[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
156+
static const char *const ora_days[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
157157
"Thursday", "Friday", "Saturday", NULL};
158158

159159
#define CASE_fmt_YYYY case 0: case 1: case 2: case 3: case 4: case 5: case 6:
@@ -169,7 +169,7 @@ const char *const ora_days[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
169169
#define CASE_fmt_HH case 27: case 28: case 29:
170170
#define CASE_fmt_MI case 30:
171171

172-
const char *const date_fmt[] =
172+
static const char *const date_fmt[] =
173173
{
174174
"Y", "Yy", "Yyy", "Yyyy", "Year", "Syyyy", "syear",
175175
"I", "Iy", "Iyy", "Iyyy",
@@ -195,7 +195,7 @@ const char *const date_fmt[] =
195195
#define CASE_timezone_10 case 15: case 16:
196196
#define CASE_timezone_11 case 17:
197197

198-
const char *const date_timezone[] =
198+
static const char *const date_timezone[] =
199199
{
200200
"GMT", "ADT", "NST", "AST", "EDT", "CDT",
201201
"EST", "CST", "MDT", "MST", "PDT", "PST",

contrib/uuid-ossp/uuid-ossp.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -562,12 +562,20 @@ Datum
562562
ora_sys_guid(PG_FUNCTION_ARGS)
563563
{
564564
bytea *result;
565+
#ifdef HAVE_UUID_OSSP
566+
uuid_t *uuid;
567+
uuid_rc_t rc;
568+
#elif defined(HAVE_UUID_E2FS)
569+
uuid_t uu;
570+
#else /* BSD */
571+
int i;
572+
unsigned char byte_array[SYS_GUID_LENGTH];
573+
#endif
574+
565575
result = (bytea *)palloc(VARHDRSZ + SYS_GUID_LENGTH);
566576
SET_VARSIZE(result, VARHDRSZ + SYS_GUID_LENGTH);
567577

568578
#ifdef HAVE_UUID_OSSP
569-
uuid_t *uuid;
570-
uuid_rc_t rc;
571579
uuid = get_cached_uuid_t(0);
572580
rc = uuid_make(uuid, UUID_MAKE_V4, NULL, NULL);
573581
if (rc != UUID_RC_OK) {
@@ -576,17 +584,14 @@ ora_sys_guid(PG_FUNCTION_ARGS)
576584
memcpy(VARDATA(result), (unsigned char *)uuid, SYS_GUID_LENGTH);
577585

578586
#elif defined(HAVE_UUID_E2FS)
579-
uuid_t uu;
580587
uuid_generate_random(uu);
581588
memcpy(VARDATA(result), uu, SYS_GUID_LENGTH);
582589

583590
#else /* BSD */
584-
int i;
585-
unsigned char byte_array[SYS_GUID_LENGTH];
586591
for (i = 0; i < SYS_GUID_LENGTH; i++) {
587592
byte_array[i] = (unsigned char)arc4random();
588593
}
589594
memcpy(VARDATA(result), byte_array, SYS_GUID_LENGTH);
590595
#endif
591596
PG_RETURN_BYTEA_P(result);
592-
}
597+
}

docker-compose.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
services:
2+
dev:
3+
build:
4+
context: .
5+
dockerfile: .devcontainer/Dockerfile
6+
image: ivorysql-dev
7+
container_name: ivorysql-dev
8+
volumes:
9+
- .:/home/ivorysql/IvorySQL:rw
10+
working_dir: /home/ivorysql/IvorySQL
11+
command: ["sleep", "infinity"]
12+
13+
# docker compose --profile ora up -d
14+
oracle:
15+
profiles: [ora]
16+
image: container-registry.oracle.com/database/free:23.26.0.0-lite
17+
environment:
18+
ORACLE_PWD: orapwd

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
#include "utils/memutils.h"
109109
#endif
110110

111-
extern int bootstrap_database_mode;
111+
112112
/* timeline ID to be used when bootstrapping */
113113
#define BootstrapTimeLineID 1
114114

0 commit comments

Comments
 (0)