Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash while using @count and List<String> #5832

Closed
f3n1kc opened this issue Jun 27, 2018 · 6 comments
Closed

Crash while using @count and List<String> #5832

f3n1kc opened this issue Jun 27, 2018 · 6 comments

Comments

@f3n1kc
Copy link

f3n1kc commented Jun 27, 2018

Goals

Use predicate with @count on top of String collection (List< String >)

Expected Results

Filtering realm results using provided predicate works without crashes

Actual Results

App crashes:

** Terminating app due to uncaught exception 'RLMException', reason: 'Column does not exist'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001146651e6 __exceptionPreprocess + 294
	1   libobjc.A.dylib                     0x0000000112dbd031 objc_exception_throw + 48
	2   Realm                               0x000000010f6c35c7 _Z20RLMThrowResultsErrorP8NSString + 983
	3   Realm                               0x000000010f6c7c09 _ZL25translateRLMResultsErrorsIZ28-[RLMResults fastEnumerator]E4$_21EDaOT_P8NSString + 121
	4   Realm                               0x000000010f6c7b7b -[RLMResults fastEnumerator] + 43
	5   Realm                               0x000000010f52d0c1 _Z16RLMFastEnumerateP22NSFastEnumerationStatemPU28objcproto17RLMFastEnumerable11objc_object + 81
	6   Realm                               0x000000010f6c3f53 -[RLMResults countByEnumeratingWithState:objects:count:] + 83
	7   libswiftFoundation.dylib            0x00000001166e47fc _T010Foundation25NSFastEnumerationIteratorV4nextypSgyF + 252

Steps to Reproduce

  1. Have a test object with list of strings
class Test: Object {
  let ids = List<String>()
}
  1. query items, whose ids count is 0
let result = (try! Realm()).objects(Test.self).filter("ids.@count == 0")
  1. try to print / access results
  2. crash

Version of Realm and Tooling

productName: Mac OS X
ProductVersion: 10.13.3
BuildVersion: 17D47

/Applications/Xcode.app/Contents/Developer
Xcode 9.3
Build version 9E145

/Users/artjom/.rvm/gems/ruby-2.3.1/bin/pod
1.5.2
Realm (3.5.0)
RealmSwift (3.5.0)
RealmSwift (= 3.5.0)

/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)

/usr/local/bin/carthage
0.26.2
(not in use here)

/usr/bin/git
git version 2.15.1 (Apple Git-101)

@tgoyne
Copy link
Member

tgoyne commented Jul 11, 2018

Querying on lists of Strings is not yet implemented. This should probably be giving a better error message, though.

@OndrejHRIC
Copy link

Any updates or workarounds pls? Im getting this reason when I used "imageFilenames.@count.intValue > 1"
It is a List<String>

'Property 'imageFilenames' is not a link in object of type 'LocalArtwork''

When I dont use ".intValue" it crashes somewhere as EXC_BAD_ACCESS.

I lost about two hours to find that it isn't implemented.
Will it be fixed in near future please? You're making great job, but this is annoying.

@somedev
Copy link

somedev commented Nov 21, 2018

Any updates for this issue?
In my case it's collection of Int (List<Int>) with same result (crash)

@RealmBot RealmBot changed the title Crash while using @count and List<String> Crash while using @count and List<String> Nov 12, 2019
@RomainQuidet
Copy link

RomainQuidet commented Jul 16, 2020

+1 This feature is really needed, even more any predicate on List<String> is really missing here!

@jsflax
Copy link
Contributor

jsflax commented Jan 21, 2021

Will be fixed by #7056.

@bmunkholm
Copy link
Contributor

Fixed by #7056

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants