kuzudb / kuzu

Embeddable property graph database management system built for query speed and scalability. Implements Cypher.
https://kuzudb.com/
MIT License
1.07k stars 77 forks source link

Fix warnings from GCC 13 #3387

Closed benjaminwinger closed 2 weeks ago

benjaminwinger commented 2 weeks ago

There are a bunch of warnings piling up with GCC 13, which I use personally, which don't show up in CI (with GCC 11). Maybe this is too much for one PR, but it's mostly minor things.

There are two bugs I found when going through the warnings:

  1. CastArrayHelper::checkCompatibleNestedTypes was falling through. This meant it was allowing MAP/STRUCT to be cast to LIST/ARRAY. STRUCT to LIST/ARRAY produces an unexpected error if you try that isn't very helpful, but it is actually possible to successfully cast MAP(<T1>, <T2>) to a STRUCT(KEY <T1>, VALUE <T2>)[].
  2. ParquetTimeStampUtils::impalaTimestampToMicroseconds was casting the impala timestamp Int96 data to a pointer and dereferencing it. I'm fairly sure it's not supposed to be storing a pointer, and I don't think this code is covered by tests. Additionally, using a pointer to cast from two int32_t to one int64_t also throws an aliasing error. As far as I can tell it's being used to store raw data read from disk, and the cast should be safe as long as the endianness matches (I don't know if parquet has any endianness requirements, but generally we assume everything is native-endian), so I switched it to use memcpy to work around the aliasing error.

Other changes: