diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2017-05-04 18:51:19 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2017-05-04 18:51:19 +0200 |
commit | a2af3c0d44d919051c08b63cb10bed546d5f92a3 (patch) | |
tree | 57bfdacb584a38ed930c1aaa87d08fe8c9a83847 /storage/connect/filamzip.cpp | |
parent | 6525dc63366f751fcfa45a586f378a1c81458657 (diff) | |
download | mariadb-git-a2af3c0d44d919051c08b63cb10bed546d5f92a3.tar.gz |
Fix MDEV-12653 Cannot add index for ZIP CONNECT table
modified: storage/connect/filamzip.cpp
modified: storage/connect/ha_connect.cc
modified: storage/connect/tabdos.cpp
modified: storage/connect/tabfmt.cpp
modified: storage/connect/tabjson.cpp
modified: storage/connect/xindex.cpp
Diffstat (limited to 'storage/connect/filamzip.cpp')
-rw-r--r-- | storage/connect/filamzip.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/storage/connect/filamzip.cpp b/storage/connect/filamzip.cpp index 66e628abb14..17ca84d9d5c 100644 --- a/storage/connect/filamzip.cpp +++ b/storage/connect/filamzip.cpp @@ -740,7 +740,13 @@ int UNZFAM::Cardinality(PGLOBAL g) int card = -1; int len = GetFileLength(g); - card = (len / (int)Lrecl) * 2; // Estimated ??? + if (len) { + // Estimated ??? + card = (len / (int)Lrecl) * 2; + card = card ? card : 10; // Lrecl can be too big + } else + card = 0; + return card; } // end of Cardinality |