Skip to content

Commit a1eedc3

Browse files
committed
fix warnings on compiler for macos and powershell fix for prebuild steps
1 parent 70fcfb0 commit a1eedc3

File tree

4 files changed

+35
-9
lines changed

4 files changed

+35
-9
lines changed

.github/workflows/prebuild.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,25 @@ jobs:
6767
- name: Prebuild binaries
6868
run: npx prebuild --strip
6969

70-
- name: List generated prebuilds
70+
- name: List generated prebuilds (Unix)
71+
if: runner.os != 'Windows'
7172
run: |
7273
echo "=== Generated prebuilds ==="
7374
find prebuilds -type f -name "*.tar.gz" 2>/dev/null || echo "No tar.gz files found"
7475
ls -la prebuilds/ || echo "prebuilds directory not found"
7576
77+
- name: List generated prebuilds (Windows)
78+
if: runner.os == 'Windows'
79+
shell: powershell
80+
run: |
81+
Write-Host "=== Generated prebuilds ==="
82+
if (Test-Path prebuilds) {
83+
Get-ChildItem -Path prebuilds -Filter "*.tar.gz" -Recurse | ForEach-Object { $_.FullName }
84+
Get-ChildItem -Path prebuilds
85+
} else {
86+
Write-Host "prebuilds directory not found"
87+
}
88+
7689
- name: Upload to GitHub Release
7790
if: startsWith(github.ref, 'refs/tags/')
7891
run: npx prebuild --upload-all
@@ -132,12 +145,25 @@ jobs:
132145
- name: Prebuild Electron binaries
133146
run: npx prebuild -r electron -t ${{ matrix.electron }}.0.0 --strip
134147

135-
- name: List generated Electron prebuilds
148+
- name: List generated Electron prebuilds (Unix)
149+
if: runner.os != 'Windows'
136150
run: |
137151
echo "=== Generated Electron prebuilds ==="
138152
find prebuilds -type f -name "*.tar.gz" 2>/dev/null || echo "No tar.gz files found"
139153
ls -la prebuilds/ || echo "prebuilds directory not found"
140154
155+
- name: List generated Electron prebuilds (Windows)
156+
if: runner.os == 'Windows'
157+
shell: powershell
158+
run: |
159+
Write-Host "=== Generated Electron prebuilds ==="
160+
if (Test-Path prebuilds) {
161+
Get-ChildItem -Path prebuilds -Filter "*.tar.gz" -Recurse | ForEach-Object { $_.FullName }
162+
Get-ChildItem -Path prebuilds
163+
} else {
164+
Write-Host "prebuilds directory not found"
165+
}
166+
141167
- name: Upload to GitHub Release
142168
if: startsWith(github.ref, 'refs/tags/')
143169
run: npx prebuild -r electron --upload-all

cpp/src/js/columns/binary_column.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Napi::Object BinaryColumn::ToString(Napi::Env env) {
1919
hex.reserve(len * 2);
2020
for (size_t i = 0; i < len; ++i) {
2121
char buf[3];
22-
sprintf(buf, "%02X", static_cast<unsigned char>(s[i]));
22+
snprintf(buf, sizeof(buf), "%02X", static_cast<unsigned char>(s[i]));
2323
hex += buf;
2424
}
2525
return Napi::String::New(env, hex).As<Napi::Object>();

cpp/src/odbc/odbc_statement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
const int SQL_SERVER_MAX_STRING_SIZE = 8000;
1919

2020
// default size to retrieve from a LOB field and we don't know the size
21-
const int LOB_PACKET_SIZE = 8192;
21+
// const int LOB_PACKET_SIZE = 8192; // Currently unused
2222

2323
namespace mssql {
2424
enum class ExecutionState { Initial, Prepared, Executed, Completed, Error };

cpp/src/odbc/odbc_statement_legacy.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
const int SQL_SERVER_MAX_STRING_SIZE = 8000;
2222

2323
// default size to retrieve from a LOB field and we don't know the size
24-
const int LOB_PACKET_SIZE = 8192;
24+
// const int LOB_PACKET_SIZE = 8192; // Currently unused
2525

2626
namespace mssql {
2727

@@ -1988,7 +1988,7 @@ bool OdbcStatementLegacy::lob(const size_t row_id, size_t column) {
19881988
}
19891989

19901990
// Track the total actual bytes of data we've read
1991-
SQLLEN total_bytes_read = 0;
1991+
// SQLLEN total_bytes_read = 0; // Currently unused but kept for potential future use
19921992

19931993
if (!check_odbc_error(r)) {
19941994
SQL_LOG_DEBUG_STREAM("[" << _handle.toString() << "] lob failed to get data " << r);
@@ -2004,10 +2004,10 @@ bool OdbcStatementLegacy::lob(const size_t row_id, size_t column) {
20042004
// For the first read, if all data fit, total_bytes_to_read contains the actual byte count
20052005
if (!more) {
20062006
// All data fit in first read
2007-
total_bytes_read = capture.total_bytes_to_read;
2007+
// total_bytes_read = capture.total_bytes_to_read;
20082008
} else {
20092009
// Data didn't fit, we need to read in chunks
2010-
total_bytes_read = capture.bytes_to_read;
2010+
// total_bytes_read = capture.bytes_to_read;
20112011
}
20122012

20132013
capture.on_first_read();
@@ -2032,7 +2032,7 @@ bool OdbcStatementLegacy::lob(const size_t row_id, size_t column) {
20322032
}
20332033

20342034
// Add the bytes from this chunk
2035-
total_bytes_read += capture.bytes_to_read;
2035+
// total_bytes_read += capture.bytes_to_read;
20362036

20372037
more = check_more_read(r, status);
20382038
if (!status) {

0 commit comments

Comments
 (0)